如何使用gnu图获得径向(极坐标)图?

Dol*_*lly 10 gnuplot

我想要一个使用gnuplot的径向(极坐标)图(即在圆形坐标系(r,theta)中).

我在这里使用了这些值:

Theta Max-strain
0     3400
60    5300
120   4700
180   3800
240   4100
300   3100
360   3400
Run Code Online (Sandbox Code Playgroud)

如何使用gnu-plot获得这样的情节?

Wol*_*tan 29

我试图重新创建你的问题的情节,这就是我提出的:

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 a new line style for the grid

set grid polar 60 #set the grid to be displayed every 60 degrees
set grid ls 10

set xrange [-6000:6000] #make gnuplot to go until 6000
set yrange [-6000:6000]

set xtics axis #disply the xtics on the axis instead of on the border
set ytics axis

set xtics scale 0 #"remove" the tics so that only the y tics are displayed
set xtics ("" 1000, "" 2000, "" 3000, "" 4000, "" 5000, "" 6000) #set the xtics only go from 0 to 6000 with increment of1000 but do not display anything. This has to be done otherwise the grid will not be displayed correctly.
set ytics 0, 1000, 6000 #make the ytics go from the center (0) to 6000 with incrment of 1000

set size square 

set key lmargin

set_label(x, text) = sprintf("set label '%s' at (6500*cos(%f)), (6500*sin(%f))     center", text, x, x) #this places a label on the outside

#here all labels are 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 the line style for the plot

#and finally the 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
Run Code Online (Sandbox Code Playgroud)

上面脚本的情节

如您所见,主要区别在于角度0不在顶部而在右侧(在数学上是正确的).但是,您可以通过修改绘图中的使用减速度和set_label函数来更改此值.

正如你在剧本中看到的那样,并不是所有东西都非常清脆闪亮.如果有人找到改进,请告诉我!

最后一点"建议":尝试使用gnuplot从某些工具重现绘图并不总是合理的.gnuplot的强度通常是以最简单的方式绘制数据以便于重现.也许你可以从上面的那个剧本中踢出一些内容并且仍然对它感到满意.


osg*_*sgx 5

这是一本手册http://t16web.lanl.gov/Kawano/gnuplot/polar-e.html

 set polar
 set angles degrees
Run Code Online (Sandbox Code Playgroud)

并获得圈子:

 set grid polar
Run Code Online (Sandbox Code Playgroud)

这是一个演示:http://gnuplot.sourceforge.net/demo/polar.html

  • 谢谢.我已经尝试过使用set grid polar.但是我无法在其中显示角度,我必须指定x和y,并且获得的绘图与我想要的不匹配.我现在重新提出了我的问题.希望这次我很清楚. (2认同)