GNUPLOT多重比例相同

发布于 2025-02-03 02:21:39 字数 399 浏览 3 评论 0 原文

我发现几年前提供的解决方案非常有用:

gnuplot multiplot multiplot systy Plot Sizes sysem sized sized sized sized sized sized sys sys sys sys sys sys sys y lab

但是,如果我想在x和y轴之间与左图中的比例相同,该怎么办?

最好的,

I found the solution provided here few years ago very useful:

Gnuplot Multiplot Individual Plot Sizes + Labels

but what if I want to have the same scale ratio between x and y axes as in the left plot?

Best,

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

温馨耳语 2025-02-10 02:21:39

根据您想要的确切条件,请检查帮助大小和以下3个示例。 设置乘数布局1,2 将使您的画布分为两个半,而gnuplot将根据您给出的选项填充一半。

示例1: 设置大小比率-1 将尝试使x-/y-ranges相同的光圈比,即第一个图将以正方形出现(20 :20或1:1),第二个情节将显示为(100:20或5:1)。

示例2: 设置大小比1 将迫使图形的比率为1:1。由于轴和/或TIC标签可能需要不同量的空间,因此GNUPLOT的自动金属将导致绝对大小不同(但比率相同)的边界。

示例3:如果您想要相同的轴长度比 绝对子图大小,则最好在没有布局的情况下使用乘数,请将所有保证金设置为 0 并自己设置大小和起源(因此是比率)(检查帮助Origin 帮助大小)。然后,您必须关心标签的足够利润。

脚本:

### different sizes and ratios of multiplots
reset session

set size ratio -1
set multiplot layout 1,2
    set xlabel "one liner"
    plot x
    
    set xlabel "two\nliner"
    plot x**2
unset multiplot

pause -1

set size ratio 1
set multiplot layout 1,2
    set xlabel "one liner"
    plot x
    
    set xlabel "two\nliner"
    plot x**2
unset multiplot

pause -1

set size noratio
set multiplot
    set margins 0,0,0,0
    sizeX   = 0.4
    sizeY   = 0.8
    originX = 0.05
    originY = 0.17
    
    set origin originX, originY
    set size   sizeX,sizeY
    set xlabel "one liner"
    plot x
    
    set origin 0.5+originX, originY
    set size   sizeX, sizeY
    set xlabel "two\nliner"
    plot x**2
unset multiplot
### end of script

结果:

示例1:

“

示例2:

示例3:

Depending on what exactly you want, check help size and the following 3 examples. set multiplot layout 1,2 will split your canvas into two halfs and gnuplot will fill the halfs with the graphs depending on the options you give.

Example 1: set size ratio -1 will try to make the same aperture ratio for the x-/y-ranges, i.e. the first plot will appear as a square (20:20 or 1:1), the second plot will appear as (100:20 or 5:1).

Example 2: set size ratio 1 will force the graphs to have a ratio of 1:1. Since axis and/or tic label might need different amount of space, gnuplot's automargin will result in borders with different absolute size (but identical ratio).

Example 3: if you want same axes length ratio and same absolute subgraph size, you better use multiplot without layout, set all the margins to 0 and set the sizes and origins (and hence the ratios) yourself (check help origin, help size). Then you have to take care about enough margins for the labels.

Script:

### different sizes and ratios of multiplots
reset session

set size ratio -1
set multiplot layout 1,2
    set xlabel "one liner"
    plot x
    
    set xlabel "two\nliner"
    plot x**2
unset multiplot

pause -1

set size ratio 1
set multiplot layout 1,2
    set xlabel "one liner"
    plot x
    
    set xlabel "two\nliner"
    plot x**2
unset multiplot

pause -1

set size noratio
set multiplot
    set margins 0,0,0,0
    sizeX   = 0.4
    sizeY   = 0.8
    originX = 0.05
    originY = 0.17
    
    set origin originX, originY
    set size   sizeX,sizeY
    set xlabel "one liner"
    plot x
    
    set origin 0.5+originX, originY
    set size   sizeX, sizeY
    set xlabel "two\nliner"
    plot x**2
unset multiplot
### end of script

Results:

Example 1:

enter image description here

Example 2:

enter image description here

Example 3:

enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文