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

Function plot_set_ylim

plot/plot.c:2125–2135  ·  view source on GitHub ↗

* @brief Pin the y-axis to a fixed [min, max] range. * * The y-axis counterpart to `plot_set_xlim`; see that function for the full * contract. The two axes are independent — you may pin one and leave the * other auto-scaling. * * @param plot Plot to configure. Must be non-NULL. * @param min Lower bound of the y-axis. * @param max Upper bound of the y-axis. Must be strictly greater than @

Source from the content-addressed store, hash-verified

2123 const PlotSeries* ser = &plot->series[s];
2124 if ((ser->xData == NULL) != (first->xData == NULL)) {
2125 sharedX = false;
2126 }
2127 for (size_t r = 0; sharedX && ser->xData && r < ser->dataSize; ++r) {
2128 sharedX = r < first->dataSize && ser->xData[r] == first->xData[r];
2129 }
2130 }
2131
2132 bool ok = true;
2133 /* Header. */
2134 if (sharedX) {
2135 ok &= fputs("x", f) >= 0;
2136 }
2137 for (size_t s = 0; s < plot->seriesCount; ++s) {
2138 char fallback[32];

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected