gnuplot - gnuplot 中的极坐标图
问题描述
我有个问题。我试图做一个极坐标图,事实上我想在图中绘制一些理论线作为一些实验数据。但是理论线的范围与实验数据不同,因为我必须这样做才能让 gnuplot 绘制它。
我有以下脚本:
####
reset
set encoding utf8
set size 1,1
set terminal epslatex
set output "direccionalidad.tex"
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
set grid polar 30 #set the grid to be displayed every 60 degrees
set grid ls 10
set trange[-90:90]
f(t)=27.934*sin(1.81651*t+96.1991) # Theorical line
set xrange[-31:32]
set yrange[-30:30]
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 displayedj
set ytics (0, 6, 12) #make the ytics go from the center (0) to 6000 with incrment of 1000
unset ytics
set xtics ("5" 6, "15" 16.5, "30" 32)
# 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 rtics (5,15,30)
set rtics format ' ' scale 0
set_label(x, text) = sprintf("set label '%s' at (32*cos(%f)), (32*sin(%f)) center", text, x, x) #this places a label on the outside
eval set_label(0, "0")
eval set_label(30, "30")
eval set_label(60, "60")
eval set_label(90, "90")
eval set_label(120, "120")
eval set_label(150, "150")
eval set_label(180, "180")
eval set_label(-150, "-150")
eval set_label(-120, "-120")
eval set_label(-90, "-90")
eval set_label(-60, "-60")
eval set_label(-30, "-30")
set size square
#PLOTS
plot "direccionalidaddatos.txt" u 1:3 pointtype 7 ps 2 lt 1 lw 3 lc rgb 'blue' notitle ,\
f(t) dt '-' lc rgb 'blue' notitle
#ACABAMOS
###
这里有一些 direccionalidaddatos.txt 档案中的列示例,中间的列只是以弧度表示的角度,但它没有用,因为我只想要以度为单位的角度,所以忽略它;):
-90 -1.570796327 0.1
-85 -1.483529864 0.2
-80 -1.396263402 0.4
-75 -1.308996939 0.7
-70 -1.221730476 1.1
-65 -1.134464014 1.7
-60 -1.047197551 2.5
#
结果就是图像极坐标图
正如您在图像中看到的那样,有两个没有点的分支,我希望这些分支根本不会消失,因为它们在图形中并不意味着没有。所以如果有人知道一种使分支消失的形式,或者改进脚本让我知道嘿嘿。
非常感谢。
解决方案
你可以减少第二个绘图组件的采样范围吗?
plot "direccionalidaddatos.txt" u 1:3 pointtype 7 ps 2 lt 1 lw 3 lc rgb 'blue' notitle ,\
[-52:45] '+' using 1:(f($1)) with lines dt '-' lc rgb 'blue' notitle
推荐阅读
- c# - 使用来自不同分区的 Azure Event Hub 消息
- html - 内容长时如何防止div推送其他div
- c++ - 尝试使用 strtok 时调用构造函数
- arrays - 多重过滤器阵列 Angular
- c++ - 编译 grpc 在 cmake/cares.cmake 出现 CMake 错误
- android - 只有在 Firebase 中成功创建用户后,才能将文档添加到 Firestore?
- assembly - asm中两个不同变量声明的区别
- reactjs - 样式材料 ui React 组件
- javascript - 数组填充异步?(反应功能意外)
- scala - 如何在 Scala 中通过函数式编程编写 sum 函数