Use the raw string preface to avoid backslash hell. print r'\\\\' gives \\\\
--Matthew Goodman

=====================
Check Out My Website: http://craneium.net
Find me on LinkedIn: http://tinyurl.com/d6wlch



On Tue, Jan 25, 2011 at 5:46 PM, Ryan Grout <ayr...@gmail.com> wrote:

> On 01/25/2011 06:14 PM, Dox wrote:
>
>> Hi everyone,
>>
>> Today I was writing a SAGE tip for my blog, about using customized
>> ticks in plots, and I realize that,
>>
>> sage: p = plot(sin(x), (x, -7, 7), ticks=pi/2, tick_formatter=pi,
>> axes_labels=['$x$','$\\sin(x)$'], fontsize=14, color='red')
>>
>> sage: p.save('/home/me/fig1.pdf')
>>
>> sage: q = plot(2*x+1,(x,0,5),ticks=[[0,1,e,pi,sqrt(20)],
>> 2],tick_formatter="latex")
>> sage: q.save('/home/me/fig2.pdf')
>>
>
> you need to specify the axis labeling in the p.save part.  For example,
>
> sage = p = plot(sin(x), (x, -7, 7), color='red')
>
> sage: p.save('/home/me/fig1.pdf', ticks=pi/2, tick_formatter=pi,
> axes_labels=['$x$','$\\sin(x)$'], fontsize=14)
>
> This outputs the correct figure.  I don't think plot passes the extra
> parameters to .save, but does to .show.  I've run into this before when I
> was working on a paper.  This is how I got around the issue.
>
>
> sage: p = plot(sin(x), (x, -7, 7), ticks=pi/2, tick_formatter=pi,
> axes_labels=['$x$','$\\sin(x)$'], fontsize=14,
> color='red').show(filename='/home/me/test_ticks.pdf')
>
>
>  An extra comment: Is it possible to write $\frac{3\pi}{2}#$ in the
>> ticks instead of $\frac{3}{2}\pi$ ? Just for the sake of compactness.
>>
>
> As for this, I don't know.  My suggestion would be to try it and see if it
> works.
>
> Ryan Grout
>
>
> --
> To post to this group, send an email to sage-devel@googlegroups.com
> To unsubscribe from this group, send an email to
> sage-devel+unsubscr...@googlegroups.com<sage-devel%2bunsubscr...@googlegroups.com>
> For more options, visit this group at
> http://groups.google.com/group/sage-devel
> URL: http://www.sagemath.org
>

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to