File: arrows.dem

package info (click to toggle)
gnuplot 6.0.2%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 14,940 kB
  • sloc: ansic: 95,319; cpp: 7,590; makefile: 2,470; javascript: 2,328; sh: 1,531; lisp: 664; perl: 304; pascal: 191; tcl: 88; python: 46
file content (32 lines) | stat: -rw-r--r-- 944 bytes parent folder | download | duplicates (3)
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
#
# Demo the "with arrows" plot style
# This style differs from "with vectors" as follows:
#   plot FOO using (x):(y):(deltax):(deltay) with vectors
#   plot BAZ using (x):(y):(length):(angle) with arrows
#
set sample 11
set isosample 11
set urange [10:360]; set xrange [0:360]
set vrange [1: 10]; set yrange [0: 10]
unset key
set border 3
set tics nomirror rangelimit

set title "plot '++' using x:y:len:angle with arrows\n".\
          "    len = sqrt(x+y)      angle = x + 3*y"

set style arrow 1 noborder
plot '++' using 1:2:(sqrt($1+$2)):($1 + $2*3) with arrows as 1

pause -1 "Hit <cr> to continue"

set style arrow 2 noborder lw 2 lc palette z
set cbrange [0:12]
set palette cubehelix
f(x,y) = sqrt((x-150)*(x-150)/400. + (y-6)*(y-6))

set title "plot ... using x:y:len:angle:as:color with arrows arrowstyle variable"
plot '++' using 1:2:(sqrt($1+$2)):($1 + $2*3):(2):(f($1,$2)) with arrows as variable

pause -1 "Hit <cr> to continue"