help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to get $ inserted in Ticks


From: Ben Abbott
Subject: Re: How to get $ inserted in Ticks
Date: Mon, 31 Oct 2011 15:53:02 -0400

On Oct 28, 2011, at 3:22 AM, Reza Housseini wrote:

> Hello everyone!
> 
> I'm using the semilogy function and print my graph using epslatex as device 
> option. When I compile my .tex file in latex it complains about missing $ 
> inserted for the ticks in the y-axis. I tried to insert them using yticklabel 
> but the problem is, it's loosing the format (like 10^{5}) and it's inserting 
> the minor ticks too. How can I insert this $ signs in a smooth way without 
> changing the output format and digging to deep in the gca options? There is 
> the gnuplot option format xy $%g$. But I want to call only one function in 
> octave to give me the desired .tex file, without using a terminal with 
> gnuplot runnning?
> Any suggestion or help is really appreciated.
> My system specifications are the following:
> 
> Ubuntu: 11.10
> Octave: 3.2.4
> 
> Thank you a lot
> Reza

If you don't mind writing your own function to do the job, then you can create 
your own latex style ticklabels using a few lines.

demo semilogy 1
ytick = get (gca, 'ytick')
yticklabel = strsplit (sprintf ("$10^{%d}$\n", log10(ytick)), "\n")(1:end-1);
set (gca, 'yticklabel', yticklabel)
print -depslatexstandalone test.tex

I'm running a more recent Octave, and can't verity this works in 3.2.4 (but I 
expect it will).

Ben





reply via email to

[Prev in Thread] Current Thread [Next in Thread]