MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / af_set_axes_limits_2d

Function af_set_axes_limits_2d

src/api/c/window.cpp:119–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

117}
118
119af_err af_set_axes_limits_2d(const af_window window, const float xmin,
120 const float xmax, const float ymin,
121 const float ymax, const bool exact,
122 const af_cell* const props) {
123 try {
124 if (window == 0) { AF_ERROR("Not a valid window", AF_ERR_INTERNAL); }
125
126 ForgeManager& fgMngr = forgeManager();
127
128 fg_chart chart = nullptr;
129 // The ctype here below doesn't really matter as it is only fetching
130 // the chart. It will not set it.
131 // If this is actually being done, then it is extremely bad.
132 fg_chart_type ctype = FG_CHART_2D;
133
134 if (props->col > -1 && props->row > -1) {
135 chart = fgMngr.getChart(window, props->row, props->col, ctype);
136 } else {
137 chart = fgMngr.getChart(window, 0, 0, ctype);
138 }
139
140 double _xmin = xmin;
141 double _xmax = xmax;
142 double _ymin = ymin;
143 double _ymax = ymax;
144 if (!exact) {
145 _xmin = step_round(_xmin, false);
146 _xmax = step_round(_xmax, true);
147 _ymin = step_round(_ymin, false);
148 _ymax = step_round(_ymax, true);
149 }
150
151 fgMngr.setChartAxesOverride(chart);
152 FG_CHECK(forgePlugin().fg_set_chart_axes_limits(
153 chart, _xmin, _xmax, _ymin, _ymax, 0.0f, 0.0f));
154 }
155 CATCHALL;
156 return AF_SUCCESS;
157}
158
159af_err af_set_axes_limits_3d(const af_window window, const float xmin,
160 const float xmax, const float ymin,

Callers 1

setAxesLimitsMethod · 0.50

Calls 3

step_roundFunction · 0.85
getChartMethod · 0.80
setChartAxesOverrideMethod · 0.80

Tested by

no test coverage detected