Postscript trap [message #91081] |
Tue, 02 June 2015 08:42  |
David B
Messages: 18 Registered: January 2015
|
Junior Member |
|
|
Hello all,
so I have been outputting results into a postscript, suppose we have the following
device, file = 'test'+string(format='(I003)', j+1 )+'.ps', $
xsize=width, ysize=height, landscape=0, /color,bits_per_pixel=8, /helvetica, $
encapsulated=0, xoffset=margin, yoffset=margin
I can then use cgtext like this to position any strings:
cgtext, 0.05, 0.65, 'Whatever', /normal, charthick=th, charsize = charsize
Notice I am working in normalised coordinates.
But then if I decide to plot an image like this:
map_pos = [0.58, 0.70, 0.98, 0.98]
cgimage, lcut, position = map_pos, oposition = map_outs, /noerase, /keep_aspect
;Axes
imcontour, lcut, lcuthdr, /NODATA, position = map_outs, /noerase, $
charsize = charsize * 0.75, type = 1, subtitle = ' '
Then I become trapped into the coordinate and positioning system used by the graphic only, I can no longer position my text outside of the image or its axis without doing everything relative to that image.
If I then use a:
cgtext, 0.05, 0.65, 'whatever'
then this text is no longer relative to the page, but relative to the image axes.
How can I escape this problem and return to my 'top level' coordinate system without having to revert to awful device coordinates, or will I just have to shut up and use the device coordinates?
Thanks
David
|
|
|
Re: Postscript trap [message #91082 is a reply to message #91081] |
Tue, 02 June 2015 08:53   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
David B writes:
>
> Hello all,
>
> so I have been outputting results into a postscript, suppose we have the following
>
>
> device, file = 'test'+string(format='(I003)', j+1 )+'.ps', $
> xsize=width, ysize=height, landscape=0, /color,bits_per_pixel=8, /helvetica, $
> encapsulated=0, xoffset=margin, yoffset=margin
>
> I can then use cgtext like this to position any strings:
>
> cgtext, 0.05, 0.65, 'Whatever', /normal, charthick=th, charsize = charsize
>
> Notice I am working in normalised coordinates.
>
> But then if I decide to plot an image like this:
>
> map_pos = [0.58, 0.70, 0.98, 0.98]
>
> cgimage, lcut, position = map_pos, oposition = map_outs, /noerase, /keep_aspect
>
> ;Axes
> imcontour, lcut, lcuthdr, /NODATA, position = map_outs, /noerase, $
> charsize = charsize * 0.75, type = 1, subtitle = ' '
>
> Then I become trapped into the coordinate and positioning system used by the graphic only, I can no longer position my text outside of the image or its axis without doing everything relative to that image.
>
> If I then use a:
>
> cgtext, 0.05, 0.65, 'whatever'
>
> then this text is no longer relative to the page, but relative to the image axes.
>
> How can I escape this problem and return to my 'top level' coordinate system without having to revert to awful device coordinates, or will I just have to shut up and use the device coordinates?
Huh!? Use the NORMAL keyword on your cgText command.
I'm pretty sure what you describe can't possibly happen. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
|
|
|
Re: Postscript trap [message #91087 is a reply to message #91082] |
Wed, 03 June 2015 02:43  |
David B
Messages: 18 Registered: January 2015
|
Junior Member |
|
|
Thanks David,
turned out I was being an idiot. I have a habit recently of looking at code and missing what I have typed into the line. I think I have so much 'cgtext' I became blind to its keywords.
Regards
David
|
|
|