|
From: Grothausmann, R. Dr. <gro...@mh...> - 2016-08-04 11:21:21
|
Many thanks theozh! The way of assigning values from data to variables through empty plot commands was completely new to me. It works great for wxt (https://github.com/romangrothausmann/KursgleicheNG/blob/8c9eb5c69e77da7e9102beefa8c139d409717719/windrose.gp), but even though SVG supports rotated labels, the "empty plots" cause SVG end-tags for groups that have no start-tag which results in invalid SVGs. Is that expected? On 02/08/16 23:04, theozh wrote: > well, you could do it with setting labels... > > However, the example below is a bit a cumbersome workaround, but it > seems to do the job in a wxt terminal. > - the first data column is used to define the position > - the second data column gives the label text > - the third data column defines the rotation > The first 3 plot command are not plotting anything but extracting > numbers and text into the variables a,b,c. > > Hope this helps... > Maybe there is a more elegant version? > > > reset > > $Data <<EOD > 1 one -30 > 2 two -60 > 3 three -90 > 4 four -120 > 5 five -150 > 6 six -180 > 7 seven -210 > 8 eight -240 > 9 nine -270 > 10 ten -300 > 11 eleven -330 > 12 twelve -360 > EOD > > set xrange [0:10] > set yrange [0:10] > set size square > unset xtics > unset ytics > n = 12. # . for floating point division > set angles degrees > do for [i=1:n] { > plot $Data u 1:(a=$1,0/0) every 1:1:i-2:0:i-1:0 notitle; > plot $Data u 1:(b=stringcolumn(2),0/0) every 1:1:i-2:0:i-1:0 notitle; > plot $Data u 1:(c=$3,0/0) every 1:1:i-1:0:i-1:0 notitle; > set label i center at (5+5*cos(-i/n*360+90)),(5+5*sin(-i/n*360+90))\ > sprintf("%s",b) rotate by c font "Arial,20"; > } > > plot $Data u 1:1 notitle # or whatever else you need to plot > |