如何为PM3D图设置X2LABEL?

发布于 2025-01-20 14:36:41 字数 999 浏览 1 评论 0原文

我想在 x-x2 和 y-y2 轴上绘制具有不同比例的 pm3d 图(即“光学厚度”和“实际厚度”)。我可以使轴上的抽动不同,但 x2labely2label 不会显示。您能推荐一个解决方案吗?

n1 = 1.2
n2 = 1.3

set view map

set link x2 via x*670/2/pi/n1 inverse 2*pi/670*n1*x 
set link y2 via y*670/2/pi/n2 inverse 2*pi/670*n2*y 

set xlabel "{/Symbol a}=2{/Symbol p}/{/Symbol l}n_1L" 
set x2label "L_1(n_1) [nm]" 
set ylabel "{/Symbol b}=2{/Symbol p}/{/Symbol l}n_2L" 
set y2label "L_2(n_2) [nm]" 

set xtics nomirror
set ytics nomirror

set x2tics 100
set y2tics 100

unset colorbox

splot sin(x)*y**2 w pm3d

没有绘图x2 和 y2label

我有一个手动解决方案,类似于:

set label 1 at screen 0.95, screen 0.5 "L_2(n_2) [nm]" rotate by 90

但这不是我认为的最好方法。

手动解决方案

I want to make a pm3d plot with different scales on the x-x2 and y-y2 axes (namely 'optical thickness' and 'real thickness'). I can make the tics different on the axes, but the x2label and y2label are not shown. Could you recommend a solution?

n1 = 1.2
n2 = 1.3

set view map

set link x2 via x*670/2/pi/n1 inverse 2*pi/670*n1*x 
set link y2 via y*670/2/pi/n2 inverse 2*pi/670*n2*y 

set xlabel "{/Symbol a}=2{/Symbol p}/{/Symbol l}n_1L" 
set x2label "L_1(n_1) [nm]" 
set ylabel "{/Symbol b}=2{/Symbol p}/{/Symbol l}n_2L" 
set y2label "L_2(n_2) [nm]" 

set xtics nomirror
set ytics nomirror

set x2tics 100
set y2tics 100

unset colorbox

splot sin(x)*y**2 w pm3d

plot without x2 and y2label

I have a manual solution with something like:

set label 1 at screen 0.95, screen 0.5 "L_2(n_2) [nm]" rotate by 90

but it is not the best way I think.

manual solution

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

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

发布评论

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

评论(2

梦晓ヶ微光ヅ倾城 2025-01-27 14:36:41

您可能可以使用plot w image,而不是使用splot w pm3d
立即,我在 gnuplot help 中找不到任何有用的信息,为什么“3D”图中没有 x2label。也许有,只是我还没有找到。

脚本:

### plot a map via "plot w image" instead of "splot w pm3d"
reset session

set xlabel  "{/Symbol a}=2{/Symbol p}/{/Symbol l}n_1L" 
set x2label "L_1(n_1) [nm]" 
set ylabel  "{/Symbol b}=2{/Symbol p}/{/Symbol l}n_2L" 
set y2label "L_2(n_2) [nm]" 

set xtics nomirror out
set mxtics 2
set ytics nomirror out
set x2tics 200 out
set mx2tics 2
set y2tics 200 out

n1 = 1.2
n2 = 1.3
set link x2 via x*670/2/pi/n1 inverse 2*pi/670*n1*x 
set link y2 via y*670/2/pi/n2 inverse 2*pi/670*n2*y 

unset colorbox
set urange[-10:10]
set vrange[-10:10]
set samples 100
set isosamples 100

plot '++' u 1:2:(sin($1)*$2**2) w image
### end of script

结果:

在此处输入图像描述

Instead of using splot w pm3d you probably could use plot w image.
Right away, I couldn't find any useful information in gnuplot help why there is no x2label in a "3D"-plot. Maybe there is and I just haven't found it.

Script:

### plot a map via "plot w image" instead of "splot w pm3d"
reset session

set xlabel  "{/Symbol a}=2{/Symbol p}/{/Symbol l}n_1L" 
set x2label "L_1(n_1) [nm]" 
set ylabel  "{/Symbol b}=2{/Symbol p}/{/Symbol l}n_2L" 
set y2label "L_2(n_2) [nm]" 

set xtics nomirror out
set mxtics 2
set ytics nomirror out
set x2tics 200 out
set mx2tics 2
set y2tics 200 out

n1 = 1.2
n2 = 1.3
set link x2 via x*670/2/pi/n1 inverse 2*pi/670*n1*x 
set link y2 via y*670/2/pi/n2 inverse 2*pi/670*n2*y 

unset colorbox
set urange[-10:10]
set vrange[-10:10]
set samples 100
set isosamples 100

plot '++' u 1:2:(sin($1)*$2**2) w image
### end of script

Result:

enter image description here

从来不烧饼 2025-01-27 14:36:41

事实证明,这是版本5.2中的错误。它将在版本5.4.4中固定。

a href =“ https://sourceforge.net/p/gnuplot/bugs/2519/”

< a href =“ https://sourceforge.net/p/gnuplot/bugs/2484/”

It was turn out, that is a bug in version 5.2. It will be fixed in release 5.4.4.

https://sourceforge.net/p/gnuplot/bugs/2519/

https://sourceforge.net/p/gnuplot/bugs/2484/

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