Re: Issues with drawing polygon markers on map

From: Kyle Griffin <ksgriffin2_at_nyahnyahspammersnyahnyah>
Date: Tue Sep 25 2012 - 22:32:23 MDT

Hi Derek,

A quick solution - after glancing over your script, you have an unnecessary
line in

 polyres = eres
 polyres = True

as the second line undoes the first. More to the point, however, is that
you aren't saving the graphic created by gsn_add_polymarker. As you can see
on the NCL page,

http://www.ncl.ucar.edu/Document/Graphics/Interfaces/gsn_add_polymarker.shtml

gsn_add_polymarker is a function and not a procedure and as a result
returns an object (in this case the marker graphic) that must be preserved
until you call draw(wks) for that plot. If you were making multiple calls
to gsn_add_polymarker, the returned graphic for each call would need to be
stored in a unique variable. So a simple line like

dum1 = gsn_add_polymarker(......)

should do the trick.

Kyle
----------------------------------------
Kyle S. Griffin
Department of Atmospheric and Oceanic Sciences
University of Wisconsin - Madison
1225 W Dayton St, Madison, WI 53706
Room 1421 Email: ksgriffin2@wisc.edu

On Tue, Sep 25, 2012 at 11:04 PM, Derek Mallia <tartanrunner25@yahoo.com>wrote:

> Hello,
>
> I am in the process of writing a script that will loop through Carbon
> Tracker CO2 flux data over the course of a year which are in daily files in
> 3 dimensions which include latitude, longitude and time (every three hours)
> and it plots 4 maps with the variables that I selected/created from the
> input file. Overall, the script is working fine, except now I am now trying
> to incorporate polygon markers (circles) after specific lat lons on the
> maps that I am making with the script. The issue arises when I attempt to
> plot these polygons as no circles are plotting at the desired location. For
> simplicities sake, I am only trying to plot one polygon for now until I can
> get one to plot at a designated lat lon of 35 -110. It should be noted that
> I am getting no errors. I have also tried looking at the examples which
> hasn't helped me find a solution to my problem. Besides that, everything
> else in the script is working as intended.
>
> The section of code that deals with the polygon creation and addition to
> the map are lines: 235-240, and the map creation part is lines 350-450. In
> the map creation part I am simply creating 4 different maps with different
> titles and color tables and it is the 3rd map "biomass fore emissions"
> where I am attempting to add polygons.
>
>
> Anyways, I attached the script to this email. If the script is too long
> let me know and I can do my best to simplify it and/or tab it out. Also, if
> needed, I can move my input data to location on my schools server where you
> guys can access it.
>
>
> Thanks!!
>
>
>
>
> Derek Mallia
>
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Sep 25 22:32:51 2012

This archive was generated by hypermail 2.1.8 : Wed Sep 26 2012 - 13:56:03 MDT