gnuplot - 输出 y 轴变平
问题描述
我试图重现这一点(第一个答案是 12 个盒子),但我的输出被粉碎、变平,例如,y 轴都变平了。这是我在文本文件中的内容,然后在命令行运行 gnuplot
### curves with different ranges & samples within one plot command
reset session
set colorsequence classic
set terminal svg enhanced
set output "para1.svg"
###set size 600, 1400
Random = "[0:1:0.001] '+' u (2*rand(0)):(2*rand(0)) w p pt 7 ps 0.5 not"
RandomFirst = "[0:1] '+' u (2*rand(0)):(2*rand(0)) w p pt 7 ps 0.5 not"
Circle = "[0:2*pi:pi/12] '+' u (cos($1)):(sin($1)) w lp pt 7 not"
CircleFirst = "[0:2*pi] '+' u (cos($1)):(sin($1)) w lp pt 7 not"
Line = "[-0.5:0.5:0.5] '+' u 1:1 w lp pt 7 lw 2 not"
LineFirst = "[-0.5:0.5] '+' u 1:1 w lp pt 7 lw 2 not"
set multiplot layout 4,3 columnsfirst
set label 1 "random/circle/line" at screen 0.166,0.99 center
unset parametric
set title "parametric OFF"
plot @RandomFirst, @Circle, @Line
set parametric
set title "parametric ON"
plot @Random, @Circle, @Line
unset parametric
set samples 1000
set title "parametric OFF"
plot @RandomFirst, @Circle, @Line
set parametric
set title "parametric ON"
plot @Random, @Circle, @Line
set label 2 "line/random/circle" at screen 0.5,0.99 center
unset parametric
set title "parametric OFF"
plot @LineFirst, @Random, @Circle
set parametric
set title "parametric ON"
plot @Line, @Random, @Circle
set samples 3
unset parametric
set title "parametric OFF"
plot @LineFirst, @Random, @Circle
set parametric
set title "parametric ON"
plot @Line, @Random, @Circle
set label 3 "circle/line/random" at screen 0.833,0.99 center
unset parametric
set title "parametric OFF"
plot @CircleFirst, @Line, @Random,
set parametric
set title "parametric ON"
plot @Circle, @Line, @Random,
set samples 24
unset parametric
set title "parametric OFF"
plot @CircleFirst, @Line, @Random,
set parametric
set title "parametric ON"
plot @Circle, @Line, @Random,
unset multiplot
### end of code
我该怎么做才能获得 1:1 的比例?
解决方案
set size ratio 1.0
将强制地块是正方形的。但是,除非您采取措施防止标题和顶部/底部边距占据大部分空间,否则它们将是非常小的正方形。
要了解这是如何工作的,请尝试
set tmargin 0
set bmargin 0
set title offset 0,-1
###
... rest of commands as before ...
###
然后,您可以决定如何调整标题位置或如何标记各个图,使其不需要额外的垂直空间。您还可以考虑使用命令的margins
关键字set multiplot layout
。
推荐阅读
- python - (模型→FK→模型)关系上的Django注释
- vue.js - Vue:v-for 中的动态图像
- npm - 为什么当我运行 npm 时发生“错误:ENIVAL:无效参数,mkdir”
- javascript - 如何在Vue中根据窗口宽度更改元素的样式
- realm - 领域工作室无法打开从 nodejs 领域 v6.1.1 生成的新领域文件
- powershell - 如何使用powershell运行多个cmd命令
- python - 如何在python中使用正则表达式替换字符串的多个单词?
- algorithm - 我应该怎么做才能学习如何从点云中检测球体?
- c# - 图像比较 - Appium - iOS - c#
- javascript - 当创建一个对象的多个实例时,附加的方法是共享的还是复制的?