Adding Greek Characters To Plots
David Bateman
David.Bateman at motorola.com
Thu Oct 16 03:42:26 CDT 2008
Ben Abbott wrote:
>
> David, thanks for letting me handle this change. I've learned a bit
> ... in particular, I learned how simple it was to make the change ;-)
>
> The change to __go_draw_axes__.m defaults to "tex" if there is not
> axes property for "interpreter". That way you can see it at work. Once
> the axes have an interpreter property the if-block in __go_draw_axes__
> (do_tics) may be deleted ... or left as it is.
>
> A simple example of its use is below
>
> x = pi * (0:10)/10;
> xtick = [0:0.25:1.01]*pi;
> xticklabel = {'0', '\pi/4', '\pi/2', '3\pi/4', '\pi'};
> figure(1)
> clf
> axes();
> plot (x,sin(x))
> set (gca, "xtick", xtick, "xticklabel", xticklabel)
> xlim ([0, pi])
>
> If a subsequent newplot is made to the axis the ticklabels are reset
> to their default values (as is done in Matlab). I suggest the
> interpreter value do the same (which it would unless newplot() is
> modified).
This is not quite right as the test
+ if (~isfield (obj, 'interpreter'))
+ obj.interpreter = 'tex';
+ endif
in do_tics shouldn't be there and graphics.h.in should have the attached
change made to it. Note that at the suggestion of John, the default
behavior of the of the interpreter property of the axes is set to none
for compatibility. I attached an updated changeset credited to you.
The example to get what you want would then be
x = pi * (0:10)/10;
xtick = [0:0.25:1.01]*pi;
xticklabel = {'0', '\pi/4', '\pi/2', '3\pi/4', '\pi'};
figure(1)
clf
axes();
plot (x,sin(x))
set (gca, "xtick", xtick, "xticklabel", xticklabel, "interpreter", "tex")
xlim ([0, pi])
Regards
David
--
David Bateman David.Bateman at motorola.com
Motorola Labs - Paris +33 1 69 35 48 04 (Ph)
Parc Les Algorithmes, Commune de St Aubin +33 6 72 01 06 33 (Mob)
91193 Gif-Sur-Yvette FRANCE +33 1 69 35 77 01 (Fax)
The information contained in this communication has been classified as:
[x] General Business Information
[ ] Motorola Internal Use Only
[ ] Motorola Confidential Proprietary
-------------- next part --------------
A non-text attachment was scrubbed...
Name: changeset-interpreter_for_axes.patch
Type: text/x-patch
Size: 5420 bytes
Desc: not available
Url : https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20081016/ed3ae97a/attachment.bin
More information about the Help-octave
mailing list