Skip to content

Commit 9ec5a43

Browse files
author
sfeam
committed
rangelimited axes must allow for nonlinear or linked mapping
1 parent b03bd2b commit 9ec5a43

File tree

3 files changed

+21
-12
lines changed

3 files changed

+21
-12
lines changed

ChangeLog

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
2017-09-09 Ethan A Merritt <[email protected]>
1+
2017-09-10 Ethan A Merritt <[email protected]>
22

33
* src/axis.c( gen_tics ) src/axis.h( reorder_if_necessary ):
44
New macro to reorder the min/max of axis ranges (but could be used
@@ -10,6 +10,11 @@
1010
in-line ranges for linked or nonlinear axes.
1111
Bug #1964
1212

13+
* src/graphics.c (plot_border) src/boundary.c (boundary):
14+
Range-limited axes were not accounting for nonlinear or linked axes.
15+
Space reserved for long axis tic labels were making the same mistake.
16+
Bug #1965
17+
1318
2017-09-05 Ethan A Merritt <[email protected]>
1419

1520
* src/axis.c src/axis.h src/datafile.c src/gp_time.h src/gp_types.h

src/boundary.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* $Id: boundary.c,v 1.50 2017-03-09 07:10:52 sfeam Exp $
2+
* $Id: boundary.c,v 1.51 2017-09-10 21:41:52 sfeam Exp $
33
*/
44

55
/* GNUPLOT - boundary.c */
@@ -532,7 +532,7 @@ boundary(struct curve_points *plots, int count)
532532
axis_array[FIRST_X_AXIS].set_min,
533533
axis_array[FIRST_X_AXIS].set_max)) {
534534
xx = axis_log_value_checked(FIRST_X_AXIS, tic->position, "xtic");
535-
xx = AXIS_MAP(FIRST_X_AXIS, xx);
535+
xx = map_x(xx);
536536
xx += (axis_array[FIRST_X_AXIS].tic_rotate) ? length : length /2;
537537
if (maxrightlabel < xx)
538538
maxrightlabel = xx;

src/graphics.c

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#ifndef lint
2-
static char *RCSid() { return RCSid("$Id: graphics.c,v 1.569 2017-08-24 23:32:42 sfeam Exp $"); }
2+
static char *RCSid() { return RCSid("$Id: graphics.c,v 1.570 2017-09-10 21:41:52 sfeam Exp $"); }
33
#endif
44

55
/* GNUPLOT - graphics.c */
@@ -3870,8 +3870,9 @@ plot_border()
38703870
(*term->move) (plot_bounds.xleft, plot_bounds.ytop);
38713871

38723872
if (border_west && axis_array[FIRST_Y_AXIS].ticdef.rangelimited) {
3873-
max = AXIS_MAP(FIRST_Y_AXIS,axis_array[FIRST_Y_AXIS].data_max);
3874-
min = AXIS_MAP(FIRST_Y_AXIS,axis_array[FIRST_Y_AXIS].data_min);
3873+
y_axis = FIRST_Y_AXIS;
3874+
max = map_y(axis_array[FIRST_Y_AXIS].data_max);
3875+
min = map_y(axis_array[FIRST_Y_AXIS].data_min);
38753876
(*term->move) (plot_bounds.xleft, max);
38763877
(*term->vector) (plot_bounds.xleft, min);
38773878
(*term->move) (plot_bounds.xleft, plot_bounds.ybot);
@@ -3882,8 +3883,9 @@ plot_border()
38823883
}
38833884

38843885
if (border_south && axis_array[FIRST_X_AXIS].ticdef.rangelimited) {
3885-
max = AXIS_MAP(FIRST_X_AXIS,axis_array[FIRST_X_AXIS].data_max);
3886-
min = AXIS_MAP(FIRST_X_AXIS,axis_array[FIRST_X_AXIS].data_min);
3886+
x_axis = FIRST_X_AXIS;
3887+
max = map_x(axis_array[FIRST_X_AXIS].data_max);
3888+
min = map_x(axis_array[FIRST_X_AXIS].data_min);
38873889
(*term->move) (min, plot_bounds.ybot);
38883890
(*term->vector) (max, plot_bounds.ybot);
38893891
(*term->move) (plot_bounds.xright, plot_bounds.ybot);
@@ -3894,8 +3896,9 @@ plot_border()
38943896
}
38953897

38963898
if (border_east && axis_array[SECOND_Y_AXIS].ticdef.rangelimited) {
3897-
max = AXIS_MAP(SECOND_Y_AXIS,axis_array[SECOND_Y_AXIS].data_max);
3898-
min = AXIS_MAP(SECOND_Y_AXIS,axis_array[SECOND_Y_AXIS].data_min);
3899+
y_axis = SECOND_Y_AXIS;
3900+
max = map_y(axis_array[SECOND_Y_AXIS].data_max);
3901+
min = map_y(axis_array[SECOND_Y_AXIS].data_min);
38993902
(*term->move) (plot_bounds.xright, min);
39003903
(*term->vector) (plot_bounds.xright, max);
39013904
(*term->move) (plot_bounds.xright, plot_bounds.ytop);
@@ -3906,8 +3909,9 @@ plot_border()
39063909
}
39073910

39083911
if (border_north && axis_array[SECOND_X_AXIS].ticdef.rangelimited) {
3909-
max = AXIS_MAP(SECOND_X_AXIS,axis_array[SECOND_X_AXIS].data_max);
3910-
min = AXIS_MAP(SECOND_X_AXIS,axis_array[SECOND_X_AXIS].data_min);
3912+
x_axis = SECOND_X_AXIS;
3913+
max = map_x(axis_array[SECOND_X_AXIS].data_max);
3914+
min = map_x(axis_array[SECOND_X_AXIS].data_min);
39113915
(*term->move) (max, plot_bounds.ytop);
39123916
(*term->vector) (min, plot_bounds.ytop);
39133917
(*term->move) (plot_bounds.xright, plot_bounds.ytop);

0 commit comments

Comments
 (0)