[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: |
Fri, 04 Nov 2011 08:01:02 -0400 |
On Nov 4, 2011, at 3:47 AM, Reza Housseini wrote:
> On Mon, Oct 31, 2011 at 8:53 PM, Ben Abbott <address@hidden> wrote:
>
>> 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
>>
>
> Thank you Ben,
>
> I tried something similar. But I wonder why the epslatex device is not
> exporting in latex readable code? Is this a bug or is there a global option
> (for all plotting function) to insert $ in ticks?
>
> Reza
Unfortunately, there is no option for that in Octave. It may be possible to
handle it automatically. If you like you can submit a bug report. Be sure to
mark the "Item Group" as a feature request.
https://savannah.gnu.org/bugs/?group=octave
Ben
p.s. please "reply-all" so that others can benefit or respond, and reply at the
bottom to make it easier for those who arrive late to follow along.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: How to get $ inserted in Ticks,
Ben Abbott <=