Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

using powers of 10

779 views
Skip to first unread message

Hatim Hegab

unread,
Aug 25, 2004, 8:31:16 PM8/25/04
to
Peace!

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

Petrik Galvosas

unread,
Aug 25, 2004, 10:33:20 PM8/25/04
to
Hi,

> 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

Theo Hopman

unread,
Aug 26, 2004, 9:22:32 AM8/26/04
to
ha_h...@hotmail.com (Hatim Hegab) wrote in message news:<4af7723c.04082...@posting.google.com>...

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

S Singh

unread,
Aug 26, 2004, 11:17:43 AM8/26/04
to

"Theo Hopman" <tho...@uoguelph.ca> wrote in message
news:ad6737ea.04082...@posting.google.com...

> 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


Hans-Bernhard Broeker

unread,
Aug 26, 2004, 11:22:51 AM8/26/04
to
S Singh <Please-...@please-no-spam.com> wrote:

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.

S Singh

unread,
Aug 26, 2004, 2:54:49 PM8/26/04
to

"Hans-Bernhard Broeker" <bro...@physik.rwth-aachen.de> wrote in message
news:2p6dibF...@uni-berlin.de...

> 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


Petrik Galvosas

unread,
Aug 26, 2004, 5:53:06 PM8/26/04
to
> How do you do it? I have 4.0 version and could not find out how to do it.

set term X11 enhanced
set title 'some title with 10^{15}'

See also
help set terminal X11
help enhanced

Bye Petrik


Ethan Merritt

unread,
Aug 26, 2004, 6:37:51 PM8/26/04
to
In article <412E5BC2...@vuw.ac.nz>,

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

Hatim Hegab

unread,
Aug 27, 2004, 3:27:24 PM8/27/04
to
Peace!
I have tried the commands you told me about. I could have the powers of 10
in the latex file easily.
I used the command [set terminal epslatex monochrome rotate auxfile] and
then [set output file.tex] and could produce a .eps file. But,
1- The file is rotated (as you mentioned it in the command) why did you use
rotate?
2- The eps file has no numbers and no labels on it, why? and how may I
produce the labels and the numbers on my axis.

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

Petrik Galvosas

unread,
Aug 28, 2004, 8:46:12 PM8/28/04
to
> 1- The file is rotated (as you mentioned it in the command) why did you use
> rotate?

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}


0 new messages