-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
for autoscaling, merge data ranges plotted to both ends of a linked a…
…xis pair
- Loading branch information
sfeam
committed
Oct 9, 2017
1 parent
347d8bd
commit 3fe48c0
Showing
5 changed files
with
179 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,20 @@ | ||
2017-10-08 Ethan A Merritt <[email protected]> | ||
|
||
* src/axis.c (reconcile_linked_axes) src/axis.h src/plot2d.c: | ||
gnuplot version 5.0 always tracked the autoscale range on the primary | ||
axis (x1 or y1) of a linked pair, even if the data was actually plotted | ||
on x2 or y2. In verison 5.2 we track the data range on x1 x2 y1 y2 | ||
separately. This caused breakage wherever the program assumed the | ||
autoscale range on x1 (or y1) was always current. Worse, it would | ||
propagate that range onto the secondary axis, possibly overwriting the | ||
correct range. Now we introduce a new routine reconcile_linked_axes() | ||
that merges the min/max values from e.g. x1 and x2 so that the | ||
autoscaled range covers input data plotted on either axis. | ||
Bug #1973 | ||
|
||
* demo/linked_autoscale.dem: Exercise the new code (fails on previous | ||
gnuplot versions). | ||
|
||
2017-10-06 Hans-Bernhard Broeker <[email protected]> | ||
|
||
* src/command.c: Move WEXITSTATUS fall-back definition away from here. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# | ||
# Exercise combinations of linked axes and autoscaled data | ||
# Some of these produced errors or incorrect plots in previous | ||
# gnuplot versions (5.0 - 5.2) E.g. But #1973 | ||
# | ||
set samples 5 | ||
set x2tics 1 | ||
set tics nomirror | ||
set auto noextend | ||
set linetype 1 ps 2 | ||
set key Left left samplen .01 | ||
unset link x | ||
|
||
set multiplot layout 3,1 | ||
set title 'axes x1y1' | ||
plot sample [i=1:5] '+' using (i):(i) axes x1y1 with lp title 'no link' | ||
|
||
set link x2 | ||
plot sample [i=1:5] '+' using (i):(i) axes x1y1 with lp title 'set link x2' | ||
|
||
set link x2 via x*2 inv x/2 | ||
plot sample [i=1:5] '+' using (i):(i) axes x1y1 with lp title 'set link x2 via x*2 inv x/2' | ||
unset multiplot | ||
pause -1 "Hit return to continue" | ||
|
||
set multiplot layout 3,1 | ||
unset link x2 | ||
set title 'axes x2y1' | ||
plot sample [i=1:5] '+' using (i):(i) axes x2y1 with lp title 'no link' | ||
|
||
set link x2 | ||
plot sample [i=1:5] '+' using (i):(i) axes x2y1 with lp title 'set link x2' | ||
|
||
set link x2 via x*2 inv x/2 | ||
plot sample [i=1:5] '+' using (i):(i) axes x2y1 with lp title 'set link x2 via x*2 inv x/2' | ||
unset multiplot | ||
pause -1 "Hit return to continue" | ||
|
||
# | ||
# More problem cases | ||
# | ||
reset | ||
set x2tics | ||
set link x2 | ||
set key Left left samplen .01 | ||
set multiplot layout 1,2 | ||
plot 'silver.dat' using 2:1 axes x1y1 with lp, '' using 3:1 with lp axes x2y1 | ||
plot 'silver.dat' using 2:1 axes x2y1 with lp, '' using 3:1 with lp axes x1y1 | ||
unset multiplot | ||
pause -1 "Hit return to continue" | ||
|
||
reset | ||
set link y | ||
set y2tics | ||
set key Left left samplen .01 | ||
plot 'silver.dat' using 1:2 axes x1y1, '' using 1:3 axes x1y2 | ||
pause -1 "Hit return to continue" | ||
|
||
# | ||
# This is a sampling bug rather than an autoscale bug | ||
# | ||
set title "Should be 5 samples but may only get 3" | ||
set key title 'plot sample [i=1:5:1] "+" using 1:1 axes x2y1' | ||
set link x2 via x*2 inv x/2 | ||
set x2tics | ||
plot sample [i=1:5:1] '+' using 1:1 axes x2y1 with lp title 'set link x2 via x*2 inv x/2' | ||
pause -1 "Hit return to continue" | ||
reset |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters