MCPcopy Create free account
hub / github.com/KaisenAmin/c_std / plot_set_grid

Function plot_set_grid

plot/plot.c:677–687  ·  view source on GitHub ↗

* @brief Toggle the grid on / off. * * Controls whether the renderer draws the 11x11 background grid lines * inside the plot frame. The grid is drawn in @c plot->gridColor (see * plot_set_grid_color()) so its visibility against the chart's * background is style-sensitive. * * @param plot Target plot. NULL is a no-op. * @param show true to render the grid; false to hide it. */

Source from the content-addressed store, hash-verified

675bool plot_update_series_data(Plot* plot, size_t seriesIndex, const float* xData, const float* yData, size_t dataSize) {
676 PLOT_LOG("[plot_update_series_data]: enter (plot=%p, seriesIndex=%zu, dataSize=%zu)", (void*)plot, seriesIndex, dataSize);
677 if (!plot || seriesIndex >= plot->seriesCount || !yData || dataSize == 0) {
678 PLOT_LOG("[plot_update_series_data]: bad arg or OOR -> false");
679 return false;
680 }
681
682 float* xCopy = NULL;
683 if (xData) {
684 xCopy = (float*)malloc(sizeof(float) * dataSize);
685 if (!xCopy) {
686 PLOT_LOG("[plot_update_series_data]: OOM xCopy -> false");
687 return false;
688 }
689 memcpy(xCopy, xData, sizeof(float) * dataSize);
690 }

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected