File: linked_autoscale.dem

package info (click to toggle)
gnuplot 5.4.1%2Bdfsg1-1%2Bdeb11u1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 13,316 kB
  • sloc: ansic: 85,877; cpp: 7,440; makefile: 2,548; javascript: 2,322; sh: 1,542; lisp: 667; perl: 304; pascal: 191; tcl: 88; python: 46
file content (75 lines) | stat: -rw-r--r-- 2,309 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#
# 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 pt 7 ps 1
set linetype 2 pt 7 ps 1
set key Left left samplen .01
unset link x

set multiplot layout 3,1 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 title 'axes x2y1'
unset link x2
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 via x/10. inv x*10.
set link y2
set key Left right samplen .01
set multiplot layout 1,2 title "set link x2 via x/10. inv x*10\nset link y2"
plot 'silver.dat' using 1:2 axes x1y1 with lp title 'axes x1y1', \
     '' using 1:2 axes x1y2 with lp title 'axes x1y2'
plot 'silver.dat' using 1:2 axes x2y2 with lp title 'axes x2y2', \
     '' using 1:2 axes x2y1 with lp title 'axes x2y1'
unset multiplot
pause -1 "Hit return to continue"

reset
set linetype 1 lw 2 pt 6 pi -1
set link y2 via y*10. inv y/10.
set link x2
set y2tics
set key Left right samplen .01
set multiplot layout 1,2 title "set link x2\nset link y2 via y*10. inv y/10."
plot 'silver.dat' using 1:2 axes x1y1 with lp title 'axes x1y1'
plot 'silver.dat' using 1:2 axes x2y2 with lp title 'axes x2y2'
unset multiplot
pause -1 "Hit return to continue"

#
# This is a sampling bug rather than an autoscale bug
#
set title "Should be 5 samples but bug may give only 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