help-octave
[Top][All Lists]
Advanced

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

Re: Adding Greek Characters To Plots


From: Ben Abbott
Subject: Re: Adding Greek Characters To Plots
Date: Wed, 15 Oct 2008 13:48:10 -0400

On Wednesday, October 15, 2008, at 12:58PM, "Ben Abbott" <address@hidden> wrote:
>On Wednesday, October 15, 2008, at 12:03PM, "Thomas Markovich" 
><address@hidden> wrote:
>>Hi,
>>
>>So I have a few different parts of the various plots that I am trying  
>>label with greek characters. The first is, I would like my tick marks  
>>to be at every pi/2 but obviously, I would like the pi symbol. I have  
>>found the command set(gca,'xtick',-2*pi:pi/2:2*pi) and  
>>set(gca,'XTickLabel',{'-pi','-pi/2','0','pi/2','pi'})
>>, however this only gives the numbers and no symbols.
>>
>>Also, I would like to set an axis label for Y that is f(phi) and for  
>>X, phi. Additionally, I would like to label my graphs with V(phi) for  
>>one and \Psi_{1+} for the other. I have found the command
>>xlabel()
>>ylabel() But I can't figure out this one either.
>>
>>Regards,
>>
>>Thomas Markovich
>>address@hidden
>
>To do this in Matlab
>
>  set (gca, 'fontname', 'symbol')
>
>My octave does not support that behavior which may be a problem local to my 
>computer (?).
>
>Can someone verify that Octave has a symbol font?
>
>If it does work, it will change the fontname for the x/y/z labels as well. To 
>correct that ...
>
>  set (get (gca, 'xlabel'), 'fontname', 'Helvetica')
>
>Ben

If you don't mind using an *unsupported* _hack_ to tell gnuplot what you want, 
you can do the following ...

   x = pi * (0:100)/100;
   plot (x, sin(x))
   xtick = [0, 1/4, 2/4, 3/4, 1] * pi;
   xticklabel = {'0', '{/Symbol p/4}', '{/Symbol p/2}', '{/Symbol 3p/4}', 
'{/Symbol p}'};
   set (gca, 'xtick', xtick, 'xticklabel', xticklabel)

Ben




reply via email to

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