2

I am having difficulties getting text to display correctly from an IDL plot once I save to postscript. Code is something like,

p1=plot([0,1],[4,5],thick=2,line=0)
p1.xtitle='Time'
p1.font_name='Times'
p1.font_size=16
p1.ytitle='!9+string(225b)+' !8!Z(0394)!8r!Ii!7!E2!N!9 '+string(241b)
p1.save,'file.ps'

This comes out exactly as I expect in the graphics window that pops up, and will save just fine to any image format. However, if I attempt to save to ps, then the unicode symbol (0934) doesn't display properly and the 'r' that should be italicized is not. Running IDL 8.7.3 on Ubuntu 16.04.6. Any help would be appreciated.

CoryD
  • 21
  • 1

1 Answers1

0

Here are two solutions, also mentioned in the documentation.

First solution:

p1.save, 'file.ps', /BITMAP

If the plot window is displayed correctly, this can fix display issues in the saved PS file. However, you will lose the benefits of the vector format.

A second solution is to use the default DejaVuSans font:

p1 = plot(/test, YTITLE='$\langle\it\Delta r_i^2\rangle$', XTITLE='Time', FONT_SIZE=16)
p1.save, 'file.ps'
jitter
  • 346
  • 5
  • 12
  • Yeah, unfortunately I need the vector formatted eps file and would really like the italicized Delta. The \it in front of the \Delta doesn't actually seem to change anything about the way the character is displayed. – CoryD Sep 29 '20 at 18:31
  • I guess you could try using a different font, not sure if this will help https://www.harrisgeospatial.com/docs/using_truetype_fonts.html – jitter Sep 30 '20 at 14:01