Skip to content

Commit

Permalink
rangelimited axes must allow for nonlinear or linked mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
sfeam committed Sep 10, 2017
1 parent b03bd2b commit 9ec5a43
Showing 3 changed files with 21 additions and 12 deletions.
7 changes: 6 additions & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
2017-09-09 Ethan A Merritt <merritt@u.washington.edu>
2017-09-10 Ethan A Merritt <merritt@u.washington.edu>

* 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 <merritt@u.washington.edu>

* src/axis.c src/axis.h src/datafile.c src/gp_time.h src/gp_types.h
4 changes: 2 additions & 2 deletions src/boundary.c
Original file line number Diff line number Diff line change
@@ -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;
22 changes: 13 additions & 9 deletions src/graphics.c
Original file line number Diff line number Diff line change
@@ -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);

0 comments on commit 9ec5a43

Please sign in to comment.