How can I display Greek letters in legends using Octave plot?

  • Thread starter Thread starter Angelos K
  • Start date Start date
  • Tags Tags
    Octave Plot
AI Thread Summary
Displaying Greek letters in legends using Octave plots can be problematic, particularly with older versions of Octave. The user successfully used '\alpha' and '\kappa' but encountered issues with '\gamma', which displayed as "\Symbol g". Suggestions included remapping the keyboard to type Greek characters and trying double-quoted strings, but these did not resolve the issue. The discussion indicates that the problem may stem from using an outdated version of Octave, specifically version 3.0.0, with users recommending an upgrade to a newer version for better functionality. The thread concludes with the user expressing hope to build a newer version from source to resolve the issue.
Angelos K
Messages
43
Reaction score
0

Homework Statement



Hi!

I'm sorry if this is misplaced, but I didn't know where else to post it. In my thesis I need greek letters to appear in a legend for a figure generated with octave. Now I normally know how to do that. F.e. if I say:

legend('\alpha','\kappa')

everythging works brilliantly, but I need

legend('\gamma','\kappa')

and it keeps showing "\Symbol g" exept of a \gamma. I was hoping that someone might help, before this costs me another couple of hours.

Thanks,
Angelos


Homework Equations





The Attempt at a Solution


 
Physics news on Phys.org
I have never used octave for plotting, have you tried remapping your keyboard to display Greek characters? It is the obvious thing to try and allows you to intersperse ελληνικά καί αγγλικά (greek with english) with the click of a mouse (Mac) or HotKey (win). It works with most applications.
 
Thank you!

I'm not sure if I'm getting what you are suggesting, but I think your idea was to switch to a greek keyboard and simply type a gamma from there. In that case I would have a gamma in the text editor indeed, but not in the plot.
 
This is just a guess, but have you tried double-quoted strings?
 
You mean "" instead of ''?
 
Angelos K said:
You mean "" instead of ''?

"foo" instead of 'foo'.
 
Yes, it doesn't work. But thank you!
 
That seems contrary to the documentation, but maybe I am misunderstanding it.

I tried
legend('\gamma');
and it gave me a \gamma. Perhaps you need a newer version?
 
tms said:
I tried
legend('\gamma');
and it gave me a \gamma. Perhaps you need a newer version?

Sounds good! My version says:
GNU Octave, version 3.0.0
Copyright (C) 2007 John W. Eaton and others.


Do you have a newer one? My Ubuntu repository does not list a newer one, but if we not that that is the problem I might find a way around that
 
  • #10
I have the Windows pre-built binary, version 3.0.5, configured for "i686-pc-mingw32". My FreeBSD and Solaris boxes are so old they won't compile it.
 
  • #11
tms said:
I have the Windows pre-built binary, version 3.0.5, configured for "i686-pc-mingw32". My FreeBSD and Solaris boxes are so old they won't compile it.

Thanks a lot. It's probably the older version that causes the problem. I can't find a newer one in the repositories of my Ubuntu distribution, but I hope I can build it from source.
 

Similar threads

Back
Top