I am a beginner for gnuplot, I will appreciate if somebody can give me
hint for how to draw a reciprocal axis.
thanks in advance
Erkin
set parametric
set trange [0.1:25]
plot 1/t, f(t)
karl
gp> plot 1/t, f(1/t)
,of course.
hi,
thanks for the reply. it seems I have to explain my problem more
detailed.
I want to draw a plot of light intensity v.s. photon energy (E). I set
the X axis range as [E1,E2], I also want to show the corresponding
wave length of the light (lambda) in the secondary axis X2. because of
he relationship between the E and lambda is: lambda(nm)=1240/E(eV),
the range of X2 should be [lambda1, lambda2]. Please note that
lambda1>lambda2, but it can be done by reverse mode. But the problem
is the step in the X2 is not linear, it is reciprocal of the X axis.
So it should looks like a logarithmic scale, especially when the range
is big. How should I set X2?
I hope I explained my question clearly. It can be done in Origin very
easily, but I didn't find any help on all gnuplot manuals I can find.
thanks
Erkin
thanks
Erkin
gp> set xrange [0.85:1.55]
gp> set x2range [0.85:1.55]
and place the tics manually
gp> set xtics nomirror
gp> set x2tics "1450"1240/1450.0, \
"1250"1240/1250.0, \
"1050"1240/1050.0, \
"850"1240/850.0)
to where you want them. The axes are totally independant, so you´ve got
to be very careful! ;-)
erkin schrieb:
> I want to draw a plot of light intensity v.s. photon energy (E). I set
> the X axis range as [E1,E2], I also want to show the corresponding
> wave length of the light (lambda) in the secondary axis X2.
That fails for two reasons
1) gnuplot doesn't do generic axis scaling (only linear or logarithmic)
2) gnuplot doesn't do coupling of one axis to values to the other (like
the relation between E and lambda)
The closest approximation would be to make both x and x2 axis
logarithmic (to make the relation between graph positions a linear one),
then fix both ranges explicitly:
f_lambda(E) = 1240/E
set log x
set log x2
set xrange [E1:E2]
set x2range [f_lambda(E1) : f_lambda(E2)]
If for some reason logarithmic axes can't be used, you'll have to
do your x2 axis manually, using the long form of the 'set x2tics' command:
set x2range [1:10]
set x2tics (1 '100', 2 '50', 4 '25', 10 '10')
one more question, just come to my mind.
can I do ln (e based logarithmic) and lg (2 based logarithmic) axis?
thanks
Erkin
> one more question, just come to my mind.
> can I do ln (e based logarithmic) and lg (2 based logarithmic) axis?
Read "help set log" for yourself.
I have a web site that generates plots exactly as you want,
with energy on x1 and wavelength on x2
http://skuld.bmsc.washington.edu/scatter/AS_form.html
So yes, it is possible. But the intelligence lies in the script that
generates gnuplot output, not in gnuplot itself. Note that in the
scripts generated by the link above, the gnuplot axes are both mouseable,
even though one is a reciprocal axis.