* @brief Open a window and render the plot until the user closes it. * * Initialises a raylib window sized to the plot's current width/height, * sets the frame rate to 60 FPS, loads the default font, and enters a * blocking render loop that re-renders the plot every frame using the * shared internal `render_plot()` helper. The loop exits when the user * closes the window (or presses ESC, per
| 765 | * @note Hiding the legend does not free any memory; series labels are |
| 766 | * still kept on the plot and can be re-shown at any time. |
| 767 | */ |
| 768 | void plot_set_legend(Plot* plot, bool show) { |
| 769 | PLOT_LOG("[plot_set_legend]: enter (plot=%p, show=%d)", (void*)plot, (int)show); |
| 770 | if (!plot) { |
| 771 | PLOT_LOG("[plot_set_legend]: NULL plot -> noop"); |
| 772 | return; |
| 773 | } |
| 774 | plot->showLegend = show; |
| 775 | |
| 776 | PLOT_LOG("[plot_set_legend]: exit"); |
| 777 | } |
| 778 | |
| 779 | |
| 780 | /** |
| 781 | * @brief Toggle the grid on / off. |
| 782 | * |
| 783 | * Controls whether the renderer draws the 11x11 background grid lines |
| 784 | * inside the plot frame. The grid is drawn in @c plot->gridColor (see |
| 785 | * plot_set_grid_color()) so its visibility against the chart's |
| 786 | * background is style-sensitive. |
| 787 | * |
| 788 | * @param plot Target plot. NULL is a no-op. |