I use gnuplot to plot my results and I use the logarithmic scale for
the y axis.
but my numbers are represented as 1e-04 and I want it to be 1x10^-4
(to be used in a latex document).
I use latex terminal to genrate the plot and then fix these in the tex
file. but I have tens of these files, so can I generate them with the
powers of tens as above?
Hatim
> but my numbers are represented as 1e-04 and I want it to be 1x10^-4
Try something like:
set format y '$%3.1t\times10^{%T}$'
See: help format specifiers
> I use latex terminal to genrate the plot
You are better of with terminal (e)pslatex or postscript Try something
like this:
set terminal pslatex monochrome rotate auxfile
set output 'test.tex'
set format y '$%3.1t\times10^{%T}$'
plot sin(x)/10000
set out
Bye Petrik
As Petrik suggested, use `set format y` the output format of your ytic
labels. In keeping with the LaTeX philosophy of logical markup,
however, I would recommend the use of Harald Harders' numprint.sty
package, which takes numbers written as (e.g.) 1e-4 and formats them
as something like $1\times10^{-4}$. Since the formatting is done when
you compile your LaTeX document, global changes (appropriate to your
locale) are easy to make, such as changing the \times to a \cdot.
A gnuplot tic label format suitable for use with numprint.sty might be
set format y '\np{%e}'
Search ctan.org for numprint for more details.
THeo
> As Petrik suggested, use `set format y` the output format of your ytic
> labels. In keeping with the LaTeX philosophy of logical markup,
> however, [...]
Can we not get this in the normal X11 terminal? Do we have to go to latex or
post-script terminal?
-s
You're missing on context: the original posting explicitly mentioned
that this was for LaTeX output.
But yes, you can do it in X11, too, by now. The latest versions have
'enhanced' mode extended to other terminals besides postscript, so you
can use superscripts there, too.
--
Hans-Bernhard Broeker (bro...@physik.rwth-aachen.de)
Even if all the snow were burnt, ashes would remain.
> But yes, you can do it in X11, too, by now. The latest versions have
> 'enhanced' mode extended to other terminals besides postscript, so you
> can use superscripts there, too.
How do you do it? I have 4.0 version and could not find out how to do it.
Thanks.
-s
set term X11 enhanced
set title 'some title with 10^{15}'
See also
help set terminal X11
help enhanced
Bye Petrik
Correct. But you must also make sure that you have chosen a
scalable font (TrueType or Adobe Type 1). Either set it permanently
via an X resource file, e.g.:
gnuplot*font: verdana,11,bold
or specify it on the command line (very awkward):
gnuplot -fn '-monotype-arial-medium-r-normal--0-0-0-0-p-0-iso8859-15'
or specify it in the set term command:
set term x11 enhanced font "utopia,11,bold"
You can get a complete list of fonts available to X11 on your system
by using the xlsfonts command. Adding more fonts is easy, but
unfortunately system-dependent.
--
Ethan A Merritt
I have noticed that the eps files produced are smaller than the ones I used
to produce with the usual latex and dvips ones, this is great if I can only
produce the labels and the axis numbers.
thank you very much for everything,
Hatim Hegab
Rotate doesn't mean that the postscript file is rotated but the y label and
this works fine with pslatex (well, in my short example wasn't any y label at
all). If you use epslatex instead of pslatex you should get some error message
like:
gnuplot> set terminal epslatex monochrome rotate auxfile
Terminal type set to 'epslatex'
undefined variable: rotate
See help epslatex and help pslatex.
> 2- The eps file has no numbers and no labels on it, why?
Because the labels and numbers kept in the file you tell gnuplot in the set out
statement.
> and how may I produce the labels and the numbers on my axis.
Don't include the produced (e)ps file but the tex file in you master tex file.
Please refer to the help for epslatex and pslatex how you include the gnuplot
generated files since this depends a bit from the driver you choose.
If you are intended to include a pure eps file in your LaTeX document use
terminal postscript instead of (e)pslatex.
I append a short example which should get you an idea how it works
Bye Petrik
Gnuplot file:
set terminal pslatex monochrome rotate auxfile
set output 'sin.tex'
set format y '$%2.0t\times10^{%T}$'
set ylabel '$y(x)$' 4,0
set xlabel '$x$'
plot sin(x)/10000 notitle
set out
LaTeX file:
\documentclass{article}
\begin{document}
\input{sin}
\end{document}