+void
+acre_get_x_axis_data_range (acre_t *acre, double *x_min, double *x_max)
+{
+ if (x_min)
+ *x_min = acre->x_axis.data_min;
+
+ if (x_max)
+ *x_max = acre->x_axis.data_max;
+}
+
+void
+acre_get_x_axis_range (acre_t *acre, double *x_min, double *x_max)
+{
+ /* If an X range has been set, return that. */
+ if (acre->x_axis.view_range_set) {
+ if (x_min)
+ *x_min = acre->x_axis.view_min;
+
+ if (x_max)
+ *x_max = acre->x_axis.view_max;
+
+ return;
+ }
+
+ /* Otherwise, if a Y range has been set, use that to compute X. */
+ if (acre->y_axis.view_range_set) {
+ _find_x_range_given_y_range (acre, x_min, x_max,
+ acre->y_axis.view_min,
+ acre->y_axis.view_max);
+
+ return;
+ }
+
+ /* Neither view range set. Return full, data-based X range. */
+ acre_get_x_axis_data_range (acre, x_min, x_max);
+}
+
+void
+acre_set_x_axis_range (acre_t *acre, double x_min, double x_max)
+{
+ acre->x_axis.view_min = x_min;
+ acre->x_axis.view_max = x_max;
+
+ acre->x_axis.view_range_set = true;
+}
+
+void
+acre_set_x_axis_range_auto (acre_t *acre)
+{
+ acre->x_axis.view_range_set = false;
+}
+
+void
+acre_get_y_axis_data_range (acre_t *acre, double *y_min, double *y_max)
+{
+ if (y_min)
+ *y_min = acre->y_axis.data_min;
+
+ if (y_max)
+ *y_max = acre->y_axis.data_max;
+}
+
+void
+acre_get_y_axis_range (acre_t *acre, double *y_min, double *y_max)
+{
+ /* If a Y range has been set, return that. */
+ if (acre->y_axis.view_range_set) {
+ if (y_min)
+ *y_min = acre->y_axis.view_min;
+
+ if (y_max)
+ *y_max = acre->y_axis.view_max;
+
+ return;
+ }
+
+ /* Otherwise, if an X range has been set, use that to compute Y. */
+ if (acre->x_axis.view_range_set) {
+ _find_y_range_given_x_range (acre, y_min, y_max,
+ acre->x_axis.view_min,
+ acre->x_axis.view_max);
+
+ return;
+ }
+
+ /* Neither view range set. Return full data-based Y range. */
+ acre_get_y_axis_data_range (acre, y_min, y_max);
+}
+
+void
+acre_set_y_axis_range (acre_t *acre, double y_min, double y_max)
+{
+ acre->y_axis.view_min = y_min;
+ acre->y_axis.view_max = y_max;
+
+ acre->y_axis.view_range_set = true;
+}
+
+void
+acre_set_y_axis_range_auto (acre_t *acre)
+{
+ acre->y_axis.view_range_set = false;
+}
+