Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
contour plots on map with Coyote Graphics System in postscript
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  12 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
sasha.mozg...@gmail.com  
View profile  
 More options Oct 2 2012, 9:30 am
Newsgroups: comp.lang.idl-pvwave
From: sasha.mozg...@gmail.com
Date: Tue, 2 Oct 2012 06:30:27 -0700 (PDT)
Local: Tues, Oct 2 2012 9:30 am
Subject: contour plots on map with Coyote Graphics System in postscript
Hi, everybody,
did anyone ever tried to adopt the second (Coyote Graphics) example from this post
http://www.idlcoyote.com/cg_tips/compcont.php
so that it draws directly into Postscript? To draw into a graphic window and ten save it as a postscript works fine for me, but I need to do it 27x4 times, would be nice to have a way to plot it directly into postscript file.
Thanks!

Alex


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David Fanning  
View profile  
 More options Oct 2 2012, 9:54 am
Newsgroups: comp.lang.idl-pvwave
From: David Fanning <n...@idlcoyote.com>
Date: Tue, 2 Oct 2012 07:54:36 -0600
Local: Tues, Oct 2 2012 9:54 am
Subject: Re: contour plots on map with Coyote Graphics System in postscript

sasha.mozg...@gmail.com writes:
> did anyone ever tried to adopt the second (Coyote Graphics) example from this post
> http://www.idlcoyote.com/cg_tips/compcont.php
> so that it draws directly into Postscript? To draw into a graphic window and ten save it as a postscript works fine for me, but I need to do it 27x4 times, would be nice to have a way to plot it directly into postscript file.

I would do it like this:

  PS_START, Filename='whatever.ps'
  .... commands from the article
  PS_END

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.")


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
sasha.mozg...@gmail.com  
View profile  
 More options Oct 2 2012, 7:13 pm
Newsgroups: comp.lang.idl-pvwave
From: sasha.mozg...@gmail.com
Date: Tue, 2 Oct 2012 16:13:43 -0700 (PDT)
Local: Tues, Oct 2 2012 7:13 pm
Subject: Re: contour plots on map with Coyote Graphics System in postscript
Dear David,
thank you so much for your (as always) fast response.

I would have two further questions.
1. What if I do not need to create a resizeable graphic window - I just want to create PostScript file containing the filled contour plot on the map.
2. Ideally, I need multiple panels, each on its own copy of the map. Would your procedure work by just setting !p.Multi varialbles?

Sincerely
Alex


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David Fanning  
View profile  
 More options Oct 3 2012, 12:15 am
Newsgroups: comp.lang.idl-pvwave
From: David Fanning <n...@dfanning.com>
Date: Tue, 2 Oct 2012 22:15:38 -0600
Local: Wed, Oct 3 2012 12:15 am
Subject: Re: contour plots on map with Coyote Graphics System in postscript

sasha.mozg...@gmail.com writes:
> I would have two further questions.
> 1. What if I do not need to create a resizeable graphic window - I just want to create PostScript file containing the filled contour plot on the map.

Then I would leave the keywords that create a resizeable graphics
window off the commands.

> 2. Ideally, I need multiple panels, each on its own copy of the map. Would your procedure work by just setting !p.Multi varialbles?

It is as simple as 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 thue. ("Perhaps thos speakest truth.")


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
sasha.mozg...@gmail.com  
View profile  
 More options Oct 4 2012, 5:52 pm
Newsgroups: comp.lang.idl-pvwave
From: sasha.mozg...@gmail.com
Date: Thu, 4 Oct 2012 14:52:19 -0700 (PDT)
Local: Thurs, Oct 4 2012 5:52 pm
Subject: Re: contour plots on map with Coyote Graphics System in postscript
Ok, here is what I'm doing (after defining data, lon, lat and nlevels) in order to simply plot a data projected on map directly into PostScript file:
=======
set_plot, 'PS'
PageParam = PSWINDOW(/LANDSCAPE, /CM, PAGESIZE='A4')

PS_START, filename = work_path+'profiles_correlation_on_map.ps'

  levels = cgConLevels(Float(data), NLevels=nlevels+1, MinValue=Floor(Min(data)), STEP=step, Factor=1)
 LoadCT, 0
  cgLoadCT, 2, /Reverse, /Brewer, NColors=nlevels-1, Bottom=1
  TVLCT, cgColor('white', /Triple), nlevels

map = Obj_New('cgMap', 'Equirectangular', Ellipsoid=19, $
     XRange=xrange, YRange=yrange, /LatLon_Ranges, CENTER_LON=center_lon, $
     Position=[0.1, 0.1, 0.9, 0.8], Limit=[Min(lat), Min(lon), Max(lat), Max(lon)])
  map -> AddCmd, Method='Erase'
  map -> AddCmd, Method='Draw'

cgContour, data, lon, lat, /Cell_Fill, /Overplot, /Outline, C_Colors=Indgen(nlevels)+1, Levels=levels, Map=map, OutColor='White', /AddCmd

cgMap_Grid, Map=map, /Box, /AddCmd
  cgMap_Continents, Map=map, Color='tomato', /AddCmd
  cgColorbar, Range=[Min(levels), Max(levels)-step], OOB_High=nlevels, $
     NColors=nlevels-1, Bottom=1, /Discrete, $
     Title='Temperature ' + cgSymbol('deg') + 'K', $
     Position=[0.1, 0.91, 0.9, 0.95], /AddCmd

  cgControl, Execute=1

PS_END
set_plot, 'X'
==========

and here is what I get:
CGMDWINDOW::INIT-> WSET: Routine is not defined for current graphics device

Do you by any chance see what am I doing wrong?
Alex


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David Fanning  
View profile  
 More options Oct 4 2012, 6:33 pm
Newsgroups: comp.lang.idl-pvwave
From: David Fanning <n...@dfanning.com>
Date: Thu, 4 Oct 2012 16:33:00 -0600
Subject: Re: contour plots on map with Coyote Graphics System in postscript

sasha.mozg...@gmail.com writes:
> Do you by any chance see what am I doing wrong?

I would do it like this:

PS_START, filename = work_path+'profiles_correlation_on_map.ps', $
   /LANDSCAPE, /EUROPEAN

levels = cgConLevels(Float(data), NLevels=nlevels+1, $
   MinValue=Floor(Min(data)), STEP=step, Factor=1)
LoadCT, 0
cgLoadCT, 2, /Reverse, /Brewer, NColors=nlevels-1, Bottom=1
TVLCT, cgColor('white', /Triple), nlevels

map = Obj_New('cgMap', 'Equirectangular', Ellipsoid=19, $
     XRange=xrange, YRange=yrange, /LatLon_Ranges, $
     CENTER_LON=center_lon, $
     Position=[0.1, 0.1, 0.9, 0.8], $
     Limit=[Min(lat), Min(lon), Max(lat), Max(lon)])
map -> Draw

cgContour, data, lon, lat, /Cell_Fill, /Overplot, /Outline, $
     C_Colors=Indgen(nlevels)+1, Levels=levels, $
     Map=map, OutColor='White'

cgMap_Grid, Map=map, /Box
cgMap_Continents, Map=map, Color='tomato'
cgColorbar, Range=[Min(levels), Max(levels)-step], OOB_High=nlevels, $
     NColors=nlevels-1, Bottom=1, /Discrete, $
     Title='Temperature $\deg$') + 'K', $
     Position=[0.1, 0.91, 0.9, 0.95]

PS_END

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thue. ("Perhaps thos speakest truth.")


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David Fanning  
View profile  
 More options Oct 4 2012, 6:37 pm
Newsgroups: comp.lang.idl-pvwave
From: David Fanning <n...@dfanning.com>
Date: Thu, 4 Oct 2012 16:37:30 -0600
Local: Thurs, Oct 4 2012 6:37 pm
Subject: Re: contour plots on map with Coyote Graphics System in postscript

David Fanning writes:

Whoops!

This line:

>     Title='Temperature $\deg$') + 'K', $

Should be this:

    Title='Temperature $\deg$K', $

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thue. ("Perhaps thos speakest truth.")


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
sasha.mozg...@gmail.com  
View profile  
 More options Oct 10 2012, 7:48 am
Newsgroups: comp.lang.idl-pvwave
From: sasha.mozg...@gmail.com
Date: Wed, 10 Oct 2012 04:48:07 -0700 (PDT)
Local: Wed, Oct 10 2012 7:48 am
Subject: Re: contour plots on map with Coyote Graphics System in postscript

>> 2. Ideally, I need multiple panels, each on its own copy of the map. Would >>your procedure work by just setting !p.Multi varialbles?
> It is as simple as that! :-)

Does not work for me: when setting !p.multpi=[0, 2, 2, 0, 0] and running it for just one panel, I get the contour plot on the first panel, empty second panel,  the grid on the third one, and the map - on the fourth. When I try to go through cgControl (put it = 0 before this three commands, add them as /AddCnd and set it 1at the end), it accept /AddCmd in cgContour, but crashes ("X connection to localhost:11.0 broken (explicit kill or server shutdown") when I try to add /AddCmd to cgMap_Grid and cgMap_Continents.  

In plus, in grid, among [-180,180] longitudes only the positive ones are labeled, and the latitude lines are missing.

Would I also be damned by some IDL Gods?..


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
sasha.mozg...@gmail.com  
View profile  
 More options Oct 10 2012, 7:56 am
Newsgroups: comp.lang.idl-pvwave
From: sasha.mozg...@gmail.com
Date: Wed, 10 Oct 2012 04:56:16 -0700 (PDT)
Local: Wed, Oct 10 2012 7:56 am
Subject: Re: contour plots on map with Coyote Graphics System in postscript
Ooups, forgot the code producing all that fron the previous post.
=====
set_plot, 'PS'
PageParam = PSWINDOW(/LANDSCAPE, /CM, PAGESIZE='A4')

PS_START, filename = 'name.ps', /LANDSCAPE, /EUROPEAN
!P.MULTI=[0, 2, 2, 0, 0]

step = 1.0
levels = cgConLevels(NLevels=nlevels, MinValue=minimum, MaxValue=maximum)
LoadCT, 0
cgLoadCT, 25, /Reverse, /Brewer, NColors=nlevels-1, Bottom=1
TVLCT, cgColor('white', /Triple), nlevels

map = Obj_New('cgMap', 'Equirectangular', Ellipsoid=19, $
XRange=xrange, YRange=yrange, /LatLon_Ranges, $
Position=[0.1, 0.1, 0.9, 0.8], $
Limit=[Min(lat), Min(lon), Max(lat), Max(lon)])
;map -> Erase
map -> Draw

cgContour, data, lon, lat, /Fill, /Overplot, /Outline, $
    missingvalue=!Values.F_NAN, C_Colors=Indgen(nlevels)+1, label =0, Levels=levels, Title='title.ps', Map=map, OutColor='white'

cgMap_Grid, Map=map, /Box
cgMap_Continents, Map=map, Color='black', thick=5
cgColorbar, Range=[Min(levels), Max(levels)+step], OOB_High=nlevels, $
NColors=nlevels-1, Bottom=1, /Discrete, /Top, $
Tlocation='TOP', Position=[0.1, 0.96, 0.9, 0.99]

PS_END


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David Fanning  
View profile  
 More options Oct 10 2012, 8:04 am
Newsgroups: comp.lang.idl-pvwave
From: David Fanning <n...@dfanning.com>
Date: Wed, 10 Oct 2012 06:04:34 -0600
Local: Wed, Oct 10 2012 8:04 am
Subject: Re: contour plots on map with Coyote Graphics System in postscript

sasha.mozg...@gmail.com writes:
> Does not work for me: when setting !p.multpi=[0, 2, 2, 0, 0] and running it for just one panel, I get the contour plot on the first panel, empty second panel,  the grid on the third one, and the map - on the fourth. When I try to go through cgControl (put it = 0 before this three commands, add them as /AddCnd and set it 1at the end), it accept /AddCmd in cgContour, but crashes ("X connection to localhost:11.0 broken (explicit kill or server shutdown") when

I try to add /AddCmd to cgMap_Grid and cgMap_Continents.  

> In plus, in grid, among [-180,180] longitudes only the positive ones are labeled, and the latitude lines are missing.

> Would I also be damned by some IDL Gods?..

Well, this is the first I've heard about !P.Multi.
It helps to write code if you have all the pertinenet
informaton when you start. :-)

I'm teaching a class for the next couple of days, so
I have limited time, but I'll see if I can get to
this. You will have to remove all POSITION keywords
if you are going to use !P.Multi, though, or all will
be confusion of the type you are experiencing. :-)

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thue. ("Perhaps thos speakest truth.")


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
sasha.mozg...@gmail.com  
View profile  
 More options Oct 10 2012, 8:34 am
Newsgroups: comp.lang.idl-pvwave
From: sasha.mozg...@gmail.com
Date: Wed, 10 Oct 2012 05:34:27 -0700 (PDT)
Local: Wed, Oct 10 2012 8:34 am
Subject: Re: contour plots on map with Coyote Graphics System in postscript
Thank you for he quick answer, David.
There is always a way to work-around the machine when you are not educated enough:
I will create the plots one by one, then combine them with convert +/-append into 2x2 panels. :)

The missing longitude grid labels and latitude lines have however nothing to do with !p.multi. Is it possible that it only works for [0,360] and not [-180,180] longitudes?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David Fanning  
View profile  
 More options Oct 10 2012, 10:03 pm
Newsgroups: comp.lang.idl-pvwave
From: David Fanning <n...@dfanning.com>
Date: Wed, 10 Oct 2012 20:03:30 -0600
Local: Wed, Oct 10 2012 10:03 pm
Subject: Re: contour plots on map with Coyote Graphics System in postscript

sasha.mozg...@gmail.com writes:
> The missing longitude grid labels and latitude lines have however nothing to do with !p.multi. Is it possible that it only works for [0,360] and not [-180,180] longitudes?

No, this is a long story and involves what I think is
a bug in the Map_Grid program, that I have been unable
to fix successfully so far. It rears its ugly head
often when working with global map projections in
projected meter space. I should write an article
about it. I've been struggling with it for a long time.
I have been trying to avoid writing my own Map_Grid
program, but I'm thinking that may be the only way out
of this problem.

As far as doing map projections as multi-plots is concerned,
there are some definite problems with my code, that I am
not going to be able to solve until who knows when. I am
WAY behind on my real work, and need to get some of that
done before I lose my job. :-(

I'll work on this as I can.

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thue. ("Perhaps thos speakest truth.")


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »