×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Anyone know how to change fonts in figures when using Octave?

Anyone know how to change fonts in figures when using Octave?

Anyone know how to change fonts in figures when using Octave?

(OP)
Ok... well I feel foolish. I didn't have Vera loaded on this machine. I tried Arial and it worked:
title("Pressure Vessel Cylinder\nStress Distribution",'FontSize',8,'FontName','Arial')

That said, I can't seem to figure out how to list what fonts are available. Any suggestions there? I tried listfonts and it doesn't seem to be implemented yet in Octave...

Also, it would be helpful if there were a way to change all of the fonts in the figure at once. set(h,'FontName','Arial') doesn't seem to work.

Thanks for the help.

//signed//
Christopher K. Hubley
Mechanical Engineer
Sunpower Incorporated
Athens, Ohio

RE: Anyone know how to change fonts in figures when using Octave?

(OP)
Well, I still can't figure out how to find the available font names, but as far as changing the font goes a bit of tinkering produced this:

CODE

hh=findall(h,'-property','FontName')
set(hh,'FontName','Arial')
...which changes the typeface of the entire figure. :)

//signed//
Christopher K. Hubley
Mechanical Engineer
Sunpower Incorporated
Athens, Ohio

RE: Anyone know how to change fonts in figures when using Octave?

(OP)
Ok, I figured out a way to change fonts (while I was waiting for Ansys to solve something unrelated). As I originally surmised, you can select a new font by pointing Octave/Matlab to the location of the font. Like so:

CODE

hh=findall(h,'-property','FontName')
set(hh,'FontName','/usr/share/fonts/dejavu/DejaVuSerifCondensed.ttf')
It seems that Octave recognizes some font names (eg. Arial), though I cannot seem to find a way to list what the recognized font names are.

Well, the method above might be clunky, but it does a fine job of selecting new fonts. I've attached a sample.

Hope this helps someone out there. :)

//signed//
Christopher K. Hubley
Mechanical Engineer
Sunpower Incorporated
Athens, Ohio

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members! Already a Member? Login



News


Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close