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 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135
|
#
# Combine dot/dash, linecolor, and arrowstyle demos into a single file.
# Demonstrate explicit choice of both dot/dash pattern (linetype)
# and color (linecolor).
#
set termoption dash
reset
set xrange [-0.5:3.5]
set yrange [-1:1.4]
set bmargin 7
unset ytics
unset xtics
#
set title "Independent colors and dot/dash styles"
unset colorbox
#
# reset linetypes to base dash patterns
#
set for [i=1:5] linetype i dt i
#
# define line styles using explicit rgbcolor names
#
set style line 1 lt 2 lc rgb "red" lw 3
set style line 2 lt 2 lc rgb "orange" lw 2
set style line 3 lt 2 lc rgb "yellow" lw 3
set style line 4 lt 2 lc rgb "green" lw 2
#
set label 1 'set style line 1 lt 2 lc rgb "red" lw 3' at -0.4, -0.25 tc rgb "red"
set label 2 'set style line 2 lt 2 lc rgb "orange" lw 2' at -0.4, -0.35 tc rgb "orange"
set label 3 'set style line 3 lt 2 lc rgb "yellow" lw 3' at -0.4, -0.45 tc rgb "yellow"
set label 4 'set style line 4 lt 2 lc rgb "green" lw 2' at -0.4, -0.55 tc rgb "green"
set label 5 'plot ... lt 1 lc 3 ' at -0.4, -0.65 tc lt 3
set label 6 'plot ... lt 3 lc 3 ' at -0.4, -0.75 tc lt 3
set label 7 'plot ... lt 5 lc 3 ' at -0.4, -0.85 tc lt 3
#
set xlabel "You will only see dashed lines if your current terminal setting permits it"
#
show style line
#
# draw some plots
#
plot cos(x) ls 1 title 'ls 1', \
cos(x-.2) ls 2 title 'ls 2',\
cos(x-.4) ls 3 title 'ls 3',\
cos(x-.6) ls 4 title 'ls 4', \
cos(x-.8) lt 1 lc 3 title 'lt 1 lc 3', \
cos(x-1.) lt 3 lc 3 title 'lt 3 lc 3', \
cos(x-1.2) lt 5 lc 3 title 'lt 5 lc 3'
#
pause -1 "Hit return to continue"
unset for [i=1:8] label i
set title "The pointinterval property is another way to create interrupted lines"
set xlabel "This technique works best for equally spaced data points"
set bmargin 6
set offset .05, .05
set xrange [-0.5:3.3]
set style func linespoints
plot cos(x) lt -1 pi -4 pt 6 title 'pi -4', \
cos(x-.8) lt -1 pi -3 pt 7 ps 0.2 title 'pi -3 pt 7 ps 0.2', \
cos(x-.2) lt -1 pi -6 pt 7 title 'pi -6',\
cos(x-.4) lt -1 pi -3 pt 4 title 'pi -3',\
cos(x-.6) lt -1 pi -5 pt 5 title 'pi -5', \
cos(x-1.) with line lt -1 notitle, \
cos(x+.2) with line lt -1 lw 2 title 'lw 2'
#
pause -1 "Hit return to continue"
set title "The pointinterval property also works with character point symbols"
set style data linespoints
set pointintervalbox 1.5
unset xlabel
myencoding = GPVAL_ENCODING
set encoding utf8
plot '+' using 1:(cos(x-1.)) with line lt -1 lw 1 title 'lw 1', \
'+' using 1:(cos(x)) lt -1 pi -4 pt "C" title 'pi -4', \
'+' using 1:(cos(x-.8)) lt -1 pi -3 pt "D" title 'pi -3 pt "D"', \
'+' using 1:(cos(x-.2)) lt -1 pi -6 pt "✠" tc rgb "blue" title 'pi -6 tc rgb "blue"',\
'+' using 1:(cos(x-.4)) lt -1 pi -3 pt "✲" title 'pi -3',\
'+' using 1:(cos(x-.6)) lt -1 pi -5 pt "☺" title 'pi -5', \
'+' using 1:(cos(x+.2)) with line lt -1 lw 2 title 'lw 2'
pause -1 "Hit return to continue"
set encoding myencoding
reset
set xrange [-1000:1000]
set yrange [-178:86]
set tics scale 0
set style line 1 lt 1 lw 2
set style line 2 lt 1 lc rgb "skyblue" lw 2
set style arrow 1 head filled size screen 0.025,30,45 ls 1
set style arrow 2 head nofilled size screen 0.03,15 ls 2
set style arrow 3 head filled size screen 0.03,15,45 ls 1
set style arrow 4 head filled size screen 0.03,15 ls 2
set style arrow 5 heads filled size screen 0.03,15,135 ls 1
set style arrow 6 head empty size screen 0.03,15,135 ls 2
set style arrow 7 nohead ls 1
set style arrow 8 heads size screen 0.008,90 ls 2
print ' We have defined the following arrowstyles:'
show style arrow
set arrow from -500,-100 to 500,-100 as 1
set arrow from -500,-110 to 500,-110 as 2
set arrow from -500,-120 to 500,-120 as 3
set arrow from -500,-130 to 500,-130 as 4
set arrow from -500,-140 to 500,-140 as 5
set arrow from -500,-150 to 500,-150 as 6
set arrow from -500,-160 to 500,-160 as 7
set arrow from -500,-170 to 500,-170 as 8
set label 'arrowstyle 1:' at -520,-100 right
set label 'arrowstyle 2:' at -520,-110 right
set label 'arrowstyle 3:' at -520,-120 right
set label 'arrowstyle 4:' at -520,-130 right
set label 'arrowstyle 5:' at -520,-140 right
set label 'arrowstyle 6:' at -520,-150 right
set label 'arrowstyle 7:' at -520,-160 right
set label 'arrowstyle 8:' at -520,-170 right
set title 'Top: plot with vectors arrowstyle 1, Bottom: explicit arrows'
plot 'arrowstyle.dat' using 1:2:(0):3 notitle with vectors arrowstyle 3
pause -1 "Hit return to continue"
reset
|