File: boxclusters.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 (40 lines) | stat: -rw-r--r-- 1,196 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
33
34
35
36
37
38
39
40
#
# The "histograms" style automates the construction of barcharts with
# various stacking and clustering options.  But it doesn't offer much
# choice for coloring.
#
# This demo show using the "with boxes" plot style to generate clustered
# histograms with individual box coloring generated by a user-provided function.
# This could, for example, depend on data from other columns in the input.
#

set title "Clustered bar graph with individual colors\nspecified via plotstyle 'boxes'"
set title  boxed offset 0,-3 font ",15"
set style fill solid border lt -1
set style textbox opaque noborder
set boxwidth 1.0 abs
ClusterSize = 15
unset key

set yrange [0:7]
set xrange [-2:60]
set border 0
category = "Yan Tan Tethera Methera Pimp"
set xtics scale 0 ()
set ytics scale 0 nomirror
set grid y
set colorb horizontal user origin .05, .05 size .9, .05
set palette cubehelix
set bmargin at screen 0.2
set tmargin at screen 0.9

set for [i=1:4] xtics add (word(category,i) 5+(i-1)*ClusterSize)

xcoord(i) =  i*ClusterSize + column(1)
color(i)  = rand(0)

plot for [i=0:3] 'candlesticks.dat' \
     using (xcoord(i)):(column(i+2)):(color(i)) with boxes lc palette z

pause -1 "<cr> to continue"
reset