On Thu, 25 Mar 2010 08:42:05 +0100
Jose Guzman <[email protected]> wrote:
> Renato wrote:
> > and it works fine. The problem is I'd like to use greek letters in
> > the text, and also underscore indexes. Here's the latex code of
> > what I'd like:
> >
> > $\lambda_{0}$
> >
> > can I somehow display that as text next to the plot??
> >
> > thanks
> > Renato
> >
> >
> Something like this should work:
>
> sage: equation = text('$\\lambda_{0}$', fontsize=20)
>
> Remember to write an additional "\" in the string when inserting the
> \ before any latex.
>
> Best.
>
ok, the above works. I had some problems because I also needed
to use the format method on the string, so the {0} was getting
substituted with the first argument of format!! I.e. the following
didn't behave like I'd liked it to:
something = 45;
text("$\\lambda_{0}$ = {0}".format(something), (0,0.8), axis_coords=True,
horizontal_alignment='left');
As a workaround I just did this, which is working as I want it to:
something = 45;
text("$\\lambda_{0}$ = {1}".format(0,something), (0,0.8), axis_coords=True,
horizontal_alignment='left');
many thanks!!
Renato
--
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org
To unsubscribe from this group, send email to
sage-support+unsubscribegooglegroups.com or reply to this email with the words
"REMOVE ME" as the subject.