Double x-axis on a spider plot with Gnuplot

扶醉桌前 提交于 2019-12-11 11:51:59

问题


I'm making a spider (or chart, polar, etc.) plot using Gnuplot. The code works properly, but in the output figure I get a duplicate positive x-axis (looking at the figure, you can observe that the line is darker) and also a duplication of labels. How can I solve that?

The code is this:

#!/usr/bin/env gnuplot
unset border
set polar
set angles degrees
set term pngcairo enhanced size 800,800
set output 'graph_eff_10_3_accuracy_spider.png'
set xtics axis
set ytics axis
set grid polar 90
set style line 10 lt 1 lc 0 lw 0.3 # line style for the grid
set grid ls 10
set xrange[-1.5:1.5]
set yrange[-1.5:1.5]
set size square
set lmargin 12
set rmargin 12
set key font ',12'
set title font ',20'

set_label(x, text) = sprintf("set label '%s' at (1.8*cos(%f)), (1.7*sin(%f)) center", text, x, x) #this places a label on the outside
eval set_label(0, "Answer 1")
eval set_label(90, "Answer 2")
eval set_label(180, "Answer 3")
eval set_label(270, "Answer 4")

set linetype 1 lc rgb 'blue' lw 2 pt 7 ps 2 # right, post
set linetype 2 lc rgb 'red' lw 2 pt 7 ps 2 # wrong, post

plot "answers_in_post.csv" using 1:2 title '(IN, R2)' with lp lt 1

And the output figure is this:


回答1:


That is the raxis which is added in polar mode. Just do a

unset raxis
set rtics scale 0 format ''

and you should be fine.



来源:https://stackoverflow.com/questions/26297535/double-x-axis-on-a-spider-plot-with-gnuplot

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!