On Nov 21, 4:22 pm, David Fanning <n...@dfanning.com> wrote:
> pepperjack writes:
>> I'm trying to overplot a contour with a map using contour .... /
>> overplot followed by map_set ... /noerase. It works fine when I output
>> it to my screen, but when I output it to a .eps file the map_set turns
>> the entire plot one colour so I lose my contours.
>
>> Here is my code:
>
>> set_plot, 'ps'
>> device, /encapsulated, filename='chi.eps'
>> device, /color
>> !p.region = [0.0, 0.1, 1, 1]
>> loadct, 33
>> range = max(chi) - min(chi)
>> step = range/20.
>> clevs = (indgen(21)*step) + min(chi)
>> ccols = indgen(20)*(254/19)
>> contour, chi, x, y, levels=clevs,c_col=ccols,/cell_fill,/overplot
>> map_set,/noerase,/continents,/grid,/isotropic
>> colorbar, clevs,ccols, format='(i4)'
>> device,/close
>
>> I'd really appreciate any help anyone can offer with this.
>
> Well, I'm having a REALLY hard time seeing how this code
> "works fine" when output to the display. :-)
>
> Here are a couple of things I see immediately:
>
> 1. Remove the OVERPLOT keyword to Contour. Otherwise, you will
> draw over the top of what is already in the display or file.
>
> 2. You need a BITS_PER_PIXEL=8 keyword on your DEVICE command.
>
> 3. There is no way your contour plot and your map are going
> to align, unless you specify a POSITION for them.
>
> 4. If that Colorbar routine came from my web page, it isn't
> going to work at all if called like that.
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Thanks very much for your help - I have something that works looking
like this:
set_plot, 'ps'
device, /encapsulated, filename = filename
device, /color, bits_per_pixel=8
!p.region = [0.0, 0.0, 1, 1]
loadct, 33 ;select colour
table
range = max(chi_hlm1_sm)-min(chi_hlm1_sm) ;set range to
plot
step = range/20.
clevs = (indgen(21)*step) + min(chi_hlm1_sm)
ccols = indgen(20)*(254/19)
contour, chi_hlm1_sh, data.lon-180., y, levels=clevs,/cell_fill,
xstyle=1, ystyle=1\
,yrange=[-90,90], xrange=[-180,177.5], pos=[0.05 ,0.18 ,0.95 ,0.818]
map_set,/noerase,/continents,/grid,/isotropic, pos=[0.05 , 0.05,
0.95, 0.95]
colorbar, 1e+3*clevs,ccols,format = '(i4)'
device,/close
I have a couple of questions though, if you don't mind...
Is there an easier way to work out what vectors should go in the
POSITION keyword? These numbers appear to be totally random to me, and
I found them through trial and error...
Is there a way to manage the file size of the resulting .eps? I need
to compile about 100 of these figures into a latex document and it is
rapidly growing to an unmanageable size.
Thanks for your help
R
|