gnuplot - How to get a radial(polar) plot using gnu plot? -
i want radial(polar) plot using gnuplot (i.e in circular co-ordinate system(r,theta).
here have used values:
theta max-strain 0 3400 60 5300 120 4700 180 3800 240 4100 300 3100 360 3400
how such plot using gnu-plot?
i tried recreate plot of question , came with:
unset border set polar set angles degrees #set gnuplot on degrees instead of radians set style line 10 lt 1 lc 0 lw 0.3 #redefine new line style grid set grid polar 60 #set grid displayed every 60 degrees set grid ls 10 set xrange [-6000:6000] #make gnuplot go until 6000 set yrange [-6000:6000] set xtics axis #disply xtics on axis instead of on border set ytics axis set xtics scale 0 #"remove" tics y tics displayed set xtics ("" 1000, "" 2000, "" 3000, "" 4000, "" 5000, "" 6000) #set xtics go 0 6000 increment of1000 not display anything. has done otherwise grid not displayed correctly. set ytics 0, 1000, 6000 #make ytics go center (0) 6000 incrment of 1000 set size square set key lmargin set_label(x, text) = sprintf("set label '%s' @ (6500*cos(%f)), (6500*sin(%f)) center", text, x, x) #this places label on outside #here labels created eval set_label(0, "0") eval set_label(60, "60") eval set_label(120, "120") eval set_label(180, "180") eval set_label(240, "240") eval set_label(300, "300") set style line 11 lt 1 lw 2 pt 2 ps 2 #set line style plot #and plot plot "-" u 1:2 t "max strain" w lp ls 11 0 3400 60 5300 120 4700 180 3800 240 4100 300 3100 360 3400 e
as can see, major difference angle 0 not on top on right (which mathematically correct). can change modifying using deceleration in plot , set_label function.
as can see in script not crisp , shiny. if finds improvements please let me know!
one last bit of "advice": not reasonable try reproduce plot tool gnuplot. strength of gnuplot plot data in simple way reproducible. maybe can kick lines out of script above , still happy it.
Comments
Post a Comment