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
Click For Summary

Homework Help Overview

The discussion revolves around the challenge of displaying Greek letters in legends using Octave for a thesis figure. The original poster, Angelos, describes an issue where the command for the Greek letter gamma does not render correctly in the plot legend.

Discussion Character

  • Exploratory, Assumption checking

Approaches and Questions Raised

  • Participants explore various methods to resolve the issue, including remapping keyboards, using different string formats, and considering software version differences. Questions arise about the functionality of specific commands and the implications of using older software versions.

Discussion Status

The discussion is ongoing, with participants sharing their experiences and suggestions. Some guidance has been offered regarding potential solutions, but there is no explicit consensus on the best approach yet.

Contextual Notes

Participants note the version of Octave being used, which may be a factor in the problem. There is mention of limitations in accessing newer versions through repositories, which could impact the ability 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 [tex]\gamma[/tex]. Perhaps you need a newer version?
 
tms said:
I tried
legend('\gamma');
and it gave me a [tex]\gamma[/tex]. 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

  • · Replies 2 ·
Replies
2
Views
2K
Replies
4
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 6 ·
Replies
6
Views
7K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 6 ·
Replies
6
Views
4K