File: arrowstyle.dem

package info (click to toggle)
gnuplot5 5.0.0~rc%2Bdfsg2-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 11,548 kB
  • ctags: 8,104
  • sloc: ansic: 77,108; cpp: 6,848; makefile: 1,932; sh: 1,343; lisp: 657; perl: 302; awk: 235; pascal: 194; tcl: 88; python: 46
file content (53 lines) | stat: -rw-r--r-- 1,658 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
#
# $Id: arrowstyle.dem,v 1.5 2014/03/09 20:14:17 markisch Exp $
#
#
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 3 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 noborder 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 for [i=1:8] arrow from -500, (-90 - i * 10) to 500, (-90 - i * 10) as i
set for [i=1:8] label sprintf('arrowstyle %i:', i) at -520, (-90 - i * 10) right

set samples 50
set angles rad
pos(x) = 69 * sin(0.01 * x)
len(x) = 49 * sin(0.01 * x + pi/2)

do for [i=1:8] {
    set title sprintf('Top: plot with vectors arrowstyle %i,  Bottom: explicit arrows', i)
    plot '+' using 1:(pos(x)):(0):(len(x)) notitle with vectors arrowstyle i
    pause -1 "Hit return to continue"
}
#reset

#
# Show plot with data style vectors
#
set title "Plot 'file' with vectors <arrowstyle>"
set key box opaque
set xrange [*:*]
set yrange [*:10]
set for [i=1:8] style arrow i lc i
plot '1.dat' using 1:2:(+1):(+1) with vectors lt 4 filled title 'filled', \
     '2.dat' using 1:2:(+1):(+1) with vectors lt 1 heads title 'double-headed', \
     '2.dat' using ($1):(2-$2/3):(+1):(+2.5):(int($0)%8 + 1) with vectors as var ti 'arrowstyle variable'
#
pause -1 "Hi return to continue"
#
reset