comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: cgAxis labels in different orientation in PS than on screen
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: cgAxis labels in different orientation in PS than on screen [message #77612] Fri, 16 September 2011 06:03
Brian Daniel is currently offline  Brian Daniel
Messages: 80
Registered: July 2009
Member
Perfect! Thanks so much.

-B
Re: cgAxis labels in different orientation in PS than on screen [message #77616 is a reply to message #77612] Thu, 15 September 2011 15:33 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning writes:

> Try something like this before you create your cgWindow:
>
> IDL> cgWindow_SetDefs, PS_FONT=1, PS_TT_FONT='Helvetica'

Geez, these are even in cgControl, just out of alphabetical
order for some reason, which is why I missed them. So,
use the above command for all cgWindows and use this
command for any particular window.

IDL> cgControl, PS_FONT=1, PS_TT_FONT='Helvetica'

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: cgAxis labels in different orientation in PS than on screen [message #77617 is a reply to message #77616] Thu, 15 September 2011 15:27 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning writes:

> Oh! Already done! Who programmed these wonderful tools
> anyway? ;-)

Coyote tells me he put this in there a month or so ago
when I was off arranging for another bank loan to keep
the sheriff from throwing us out of the office. :-)

Cheers,

David


--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: cgAxis labels in different orientation in PS than on screen [message #77618 is a reply to message #77617] Thu, 15 September 2011 15:20 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning writes:

> Well, the problem is that PS_START sets !P.FONT=0 when
> configuring the PostScript device. You need it to be
> set to 1, to do True-Type fonts, which can rotate in
> 3D space. (Hershey fonts, !P.FONT=-1 can do this, too,
> but they suck in PostScript.)
>
> This is trickier than it looks, because *which* True-Type
> font you choose is really, really machine dependent, and
> I don't like to make this choice for the user. It probably is
> something that should be controlled by cgControl.

Oh! Already done! Who programmed these wonderful tools
anyway? ;-)

Try something like this before you create your cgWindow:

IDL> cgWindow_SetDefs, PS_FONT=1, PS_TT_FONT='Helvetica'

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: cgAxis labels in different orientation in PS than on screen [message #77619 is a reply to message #77618] Thu, 15 September 2011 14:46 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Brian J. Daniel writes:

> David, you're code is too good. I've been lulled in to a false sense
> of security that all of the cg tools will work perfectly every time,
> and all my frustrations with dg will all fade away. I'm creating 3D
> scatter plots in a cgWindow using cgSurf to create the 3D space,
> cgAxis to create the axes where I want them, and cgPlotS to plot the
> data. Using cgWindow, I programmatically save theses plots to image
> files via ImageMagick. The resulting postscript features the axis
> labels in either horizontal or vertical orientations, not the nice
> orientations in the direct graphics output on my screen.
>
> Via postscript w/ vertical and horizontal text orientations:
> http://dl.dropbox.com/u/20212184/usenet_example.png
>
> without using postscript with nice text orientations but blocky text:
> http://dl.dropbox.com/u/20212184/usenet_example_dg.png
>
> Is there a way to get the orientations to be "pretty" in postscript?

Well, the problem is that PS_START sets !P.FONT=0 when
configuring the PostScript device. You need it to be
set to 1, to do True-Type fonts, which can rotate in
3D space. (Hershey fonts, !P.FONT=-1 can do this, too,
but they suck in PostScript.)

This is trickier than it looks, because *which* True-Type
font you choose is really, really machine dependent, and
I don't like to make this choice for the user. It probably is
something that should be controlled by cgControl.

What I usually do is control this in the graphics command
I am loading into cgWindow, by putting something like this
in my code:

IF !D.Name EQ 'PS' THEN BEGIN
thisFont = !P.Font
!P.Font=1
ENDIF ELSE thisFont = !P.Font

Then, when finished with the graphics display, !P.Font = thisFont.

I'll give this some more thought this afternoon and see
if there is a better way to do this.

As it happens PSConfig (which is ultimately what is being
used to control the PostScript device here) is already
able to collect font information from the user. The
problem is that there is just no absolutely reliable
way to DEAL with font information! You are always
guessing about what the user intended.

keywords = PSConfig(/FONTINFO)

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: truncation when reading variables from netcdf file?
Next Topic: Re: How can make a simple movie from .txt files

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 17:47:38 PDT 2025

Total time taken to generate the page: 0.00389 seconds