Re: IDL eps outpt converted to png for MS PowerPoint [message #48543] |
Tue, 02 May 2006 11:39  |
newbie16
Messages: 11 Registered: December 2004
|
Junior Member |
|
|
Hi Mike:
Another way for presentation plots I use are the following lines of
code I insert into my .pro files (Using a method suggested by David
Fanning). For what it's worth, I like a black background with yellow
text for my presentations....
; Load the colour table
ctable = 26 ; Eos A
loadct, ctable
; Stretch the colours to have a more "rainbow" like distribution
gamma_ct, 1.905, /CURRENT
;=========================================================
; Set up for screen presentation
; BACKGROUND ===> BLACK
; FOREGROUND ===> YELLOW
;=========================================================
resp_PLOT = ''
print,' '
print,'PLEASE ENTER (Case sensitive!!!):'
print,'=========================='
print,' [S] --- IF YOU WISH TO CREATE PLOTS WITH '
print,' A BLACK BACKGROUND. '
print,' '
print,' [P] --- FOR A PRINT SUITABLE PLOT '
print,' TO BE USED IN LaTeX'
read, format='(a1)', resp_PLOT
print,' '
plotchoice = ['S','P']
pc = where(strupcase(resp_PLOT) eq plotchoice)
case pc[0] of
0: begin
print,'CREATING PLOT SUITABLE FOR PRESENTATION'
print,' '
; Set "mycolour" ===> 151
TVLCT, 255, 255, 0, 151 ; Redefine my own yellow
backColour = 0 ; Black background
!P.COLOR = 151 ; Sets default fonts to yellow
; Set CHARTHICK so they'll show up better on a dark background
!P.CHARTHICK=3.0
image = REPLICATE(backColour, 10, 10)
TV, image, XSIZE=!D.X_SIZE, YSIZE=!D.Y_SIZE
end
1: begin
print,'CREATING PLOT SUITABLE FOR PRINT or LaTeX'
print,' '
!P.COLOR = 0 ; Sets Fonts & outlines to black
end
else: begin
print,'CREATING PLOT SUITABLE FOR PRINT or LaTeX'
print,' '
!P.COLOR = 0 ; Sets Fonts & outlines to black
end
endcase
;=========================================================
And that's it. The major hassle is finding out what value "mycolour"
should be set to. To figure this out, I use the following steps:
(1) Use LOADCT to call whatever colour scheme you like to use.
(2) Use XPALETTE to find out what the number of "mycolour" is.
(3) Update the .pro file with the correct value and you're done.
(4) Read the "NOTES" below.
NOTE #1: Sometimes, a pure yellow, for example, may not be defined.
In this case I find the closest one, perhaps one with 255, 250, 0 RGB
values. I then reset that value to 255, 255, 0 using the TVLCT
command. For example, mycolour would be set to 207 if LOADCT called
colour table 13.
NOTE #2: The above should be called BEFORE any other command to plot
or contour and ALL SUBSEQUENT plot/contour commands should have the
"/noerase" keyword added to them. I learned that the hard way....
Cheers,
t.
|
|
|