Search code examples
plotgnuplotaxis-labels

How to set x2label for pm3d plot?


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


Solution

  • 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/