From 9ec5a436217de1258e0b6fb3e2a49ba0725dd9d0 Mon Sep 17 00:00:00 2001 From: sfeam Date: Sun, 10 Sep 2017 21:41:52 +0000 Subject: [PATCH] rangelimited axes must allow for nonlinear or linked mapping --- ChangeLog | 7 ++++++- src/boundary.c | 4 ++-- src/graphics.c | 22 +++++++++++++--------- 3 files changed, 21 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 863d6b443..cd4aa09fa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,4 @@ -2017-09-09 Ethan A Merritt +2017-09-10 Ethan A Merritt * src/axis.c( gen_tics ) src/axis.h( reorder_if_necessary ): New macro to reorder the min/max of axis ranges (but could be used @@ -10,6 +10,11 @@ in-line ranges for linked or nonlinear axes. Bug #1964 + * src/graphics.c (plot_border) src/boundary.c (boundary): + Range-limited axes were not accounting for nonlinear or linked axes. + Space reserved for long axis tic labels were making the same mistake. + Bug #1965 + 2017-09-05 Ethan A Merritt * src/axis.c src/axis.h src/datafile.c src/gp_time.h src/gp_types.h diff --git a/src/boundary.c b/src/boundary.c index 493543d8d..b303644b5 100644 --- a/src/boundary.c +++ b/src/boundary.c @@ -1,5 +1,5 @@ /* - * $Id: boundary.c,v 1.50 2017-03-09 07:10:52 sfeam Exp $ + * $Id: boundary.c,v 1.51 2017-09-10 21:41:52 sfeam Exp $ */ /* GNUPLOT - boundary.c */ @@ -532,7 +532,7 @@ boundary(struct curve_points *plots, int count) axis_array[FIRST_X_AXIS].set_min, axis_array[FIRST_X_AXIS].set_max)) { xx = axis_log_value_checked(FIRST_X_AXIS, tic->position, "xtic"); - xx = AXIS_MAP(FIRST_X_AXIS, xx); + xx = map_x(xx); xx += (axis_array[FIRST_X_AXIS].tic_rotate) ? length : length /2; if (maxrightlabel < xx) maxrightlabel = xx; diff --git a/src/graphics.c b/src/graphics.c index 4b11a5c69..e8ec0ef67 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -1,5 +1,5 @@ #ifndef lint -static char *RCSid() { return RCSid("$Id: graphics.c,v 1.569 2017-08-24 23:32:42 sfeam Exp $"); } +static char *RCSid() { return RCSid("$Id: graphics.c,v 1.570 2017-09-10 21:41:52 sfeam Exp $"); } #endif /* GNUPLOT - graphics.c */ @@ -3870,8 +3870,9 @@ plot_border() (*term->move) (plot_bounds.xleft, plot_bounds.ytop); if (border_west && axis_array[FIRST_Y_AXIS].ticdef.rangelimited) { - max = AXIS_MAP(FIRST_Y_AXIS,axis_array[FIRST_Y_AXIS].data_max); - min = AXIS_MAP(FIRST_Y_AXIS,axis_array[FIRST_Y_AXIS].data_min); + y_axis = FIRST_Y_AXIS; + max = map_y(axis_array[FIRST_Y_AXIS].data_max); + min = map_y(axis_array[FIRST_Y_AXIS].data_min); (*term->move) (plot_bounds.xleft, max); (*term->vector) (plot_bounds.xleft, min); (*term->move) (plot_bounds.xleft, plot_bounds.ybot); @@ -3882,8 +3883,9 @@ plot_border() } if (border_south && axis_array[FIRST_X_AXIS].ticdef.rangelimited) { - max = AXIS_MAP(FIRST_X_AXIS,axis_array[FIRST_X_AXIS].data_max); - min = AXIS_MAP(FIRST_X_AXIS,axis_array[FIRST_X_AXIS].data_min); + x_axis = FIRST_X_AXIS; + max = map_x(axis_array[FIRST_X_AXIS].data_max); + min = map_x(axis_array[FIRST_X_AXIS].data_min); (*term->move) (min, plot_bounds.ybot); (*term->vector) (max, plot_bounds.ybot); (*term->move) (plot_bounds.xright, plot_bounds.ybot); @@ -3894,8 +3896,9 @@ plot_border() } if (border_east && axis_array[SECOND_Y_AXIS].ticdef.rangelimited) { - max = AXIS_MAP(SECOND_Y_AXIS,axis_array[SECOND_Y_AXIS].data_max); - min = AXIS_MAP(SECOND_Y_AXIS,axis_array[SECOND_Y_AXIS].data_min); + y_axis = SECOND_Y_AXIS; + max = map_y(axis_array[SECOND_Y_AXIS].data_max); + min = map_y(axis_array[SECOND_Y_AXIS].data_min); (*term->move) (plot_bounds.xright, min); (*term->vector) (plot_bounds.xright, max); (*term->move) (plot_bounds.xright, plot_bounds.ytop); @@ -3906,8 +3909,9 @@ plot_border() } if (border_north && axis_array[SECOND_X_AXIS].ticdef.rangelimited) { - max = AXIS_MAP(SECOND_X_AXIS,axis_array[SECOND_X_AXIS].data_max); - min = AXIS_MAP(SECOND_X_AXIS,axis_array[SECOND_X_AXIS].data_min); + x_axis = SECOND_X_AXIS; + max = map_x(axis_array[SECOND_X_AXIS].data_max); + min = map_x(axis_array[SECOND_X_AXIS].data_min); (*term->move) (max, plot_bounds.ytop); (*term->vector) (min, plot_bounds.ytop); (*term->move) (plot_bounds.xright, plot_bounds.ytop);