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.
|
|
|
Re: IDL eps outpt converted to png for MS PowerPoint [message #48590 is a reply to message #48543] |
Fri, 28 April 2006 09:36  |
mchinand
Messages: 66 Registered: September 1996
|
Member |
|
|
In article <1146239004.877303.193340@u72g2000cwu.googlegroups.com>,
<newbie16@hotmail.com> wrote:
> Hi All:
>
> Recently I found myself having to convert *a lot* of eps figures I
> created using IDL into png format for a PowerPoint presentation. Well,
> this was kinda a pain to do, so I wrote a couple of small BASH shell
> scripts to ease the whole process. I provide below:
>
> (1) A small README file
> (2) "idl2ppt.sh" the main workhorse
> (3) "make_runall.sh" calls idl2ppt.sh to make many png files
>
> Please note that they work for a Linux workstation where ImageMagick's
> "convert" funtion is installed.
>
> I hope someone finds these useful!
>
> Cheers,
>
> tyler
>
Thanks for the script. For line graphs/plots I usually use the following additional options for 'convert':
+negate -transparent black
these options will make the black lines white and make the background transparent. I find this useful when
using a dark background in Powerpoint. Also, I think the Powerpoint versions from Office XP and newer will
display EPS files properly on the Windows.
--Mike
--
Michael Chinander, PhD
m-chinander@uchicago.edu
Department of Radiology
University of Chicago
|
|
|