set format y "%2.0t{/Symbol \327}10^{%L}"
works almost fine both for linear and logarithmic scale with one pity
exception: zero tick is printed as
0*10^0
instead of simple
0
A solution is to use latex+pgfplots for this task, but there are some
difficulties on this way. First (and main) is the compilation speed,
second (for my taste) is (delta x)/(delta y) ratio limitation. Maybe
something else...
Is there a simple but universal solution of this problem using Gnuplot?
That's interesting! In my experience, 0 never has come up on a
logarithmic scale:)
>
> instead of simple
>
> 0
>
> A solution is to use latex+pgfplots for this task, but there are some
> difficulties on this way. First (and main) is the compilation speed,
> second (for my taste) is (delta x)/(delta y) ratio limitation. Maybe
> something else...
>
> Is there a simple but universal solution of this problem using Gnuplot?
Apparently, there is no solution to this kind of problem, however,
even if there was, you would have a small issue with the alignment:
"0*10^0" is actually taller then "0", so, even if you can get rid of
"0*10^0", it is not clear how you would position your "0". All the
same, since I have also had this kind of problem a couple of times, I
would like to suggest that there be a "remove" tag in set xtics, or
even better, that the rule for the "add" tag be overwriting the label,
if one is at that particular position, instead of just adding the new
label to the list of xtics. I have looked at the code, and I believe,
all it would require is a search somewhere in the ticmark structure.
Please, correct me, if I am wrong.
Cheers,
Zoltán
By the way, there is a manual solution - to define the ticks and their
label using, for something like
set ytics ("-5{/Symbol \327}10^{-4}" 5e-4, "0" 0)
No unwanted shifts take place in this case. But... this is manual
solution :) It is not good enough for everyday plotting...
Is it possible to implement scientific formatting of labels in Gnuplot?
> Is it possible to draw tick labels in classic scientific format?
> Command
>
> set format y "%2.0t{/Symbol \327}10^{%L}"
>
> works almost fine both for linear and logarithmic scale with one pity
> exception: zero tick is printed as
>
> 0*10^0
>
> instead of simple
>
> 0
>
> Is there a simple but universal solution of this problem using Gnuplot?
The intent is that manually specified labels take precedence over
automatically generated labels. So the following is supposed to work
set xtics add ("0" 0)
But it doesn't work in this case.
So I will treat this as a bug report.
1. to print 1.34 as 1.34*10^0 (1.34 looks good)
2. to print 1.67*10 as 1.67*10^1 (for me the label in form of 1.67*10
or 16.7 seems to be more common)
Some editors treat the longer versions of labels as an error. I think
that these examples (including the case of "0" label) show that code
like
set format y "%2.0t{/Symbol \327}10^{%L}"
is not a good solution for creating "automatic" labels in scientific
format.
sfeam >
> The intent is that manually specified labels take precedence over
> automatically generated labels. So the following is supposed to work
>
> set xtics add ("0" 0)
>
> But it doesn't work in this case.
S> o I will treat this as a bug report.
A bug fix is now in CVS, at least for 2D plots.
Can you point to a formal definition of "scientific format"?
The labels produced this way look fine. But this is only my private
opinion. I'm not sure it is necessary to use such an algorithm of
formatting on each plot. Moreover, format "%2.0t{/Symbol \327}10^{%L}"
seems to be preferred on most "purely" logarithmic scales. I cannot
say the same about linear and "mixed" (which contain a combination of
linear and logarithmic) scaled axes.
I believe that the possibility to choose a pgfplots-like
representation of tick labels in some cases might be useful in
postscript terminal (which as far as I know is often used to prepare
publication-ready figures).