Re: how to make marker opaque

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Mon Aug 16 2010 - 14:16:27 MDT

Hi Ming,

There's no way to do this currently, although we are doing some alpha testing on opacity in NCL.

One thing I've done to fake opacity is to first create the background image that I want to put the markers on.

Then, I draw *just* the markers in black on a separate frame.

Then, I draw just the markers again, but in grayscale, which determines the opacity.

I composite and overlay these three images using ImageMagick's "convert" and "composite" tools.

Please see the attached example script and resultant "final.png" file.

Note that this method will work for just about anything you want to make opaque. You need to have a color background image,
and then a color and grayscale version of the part of the plot that you want to be opaque. This allows you to take an existing
background image, like a terrain map, and overlay contours that are opaque.

--Mary

On Aug 13, 2010, at 11:17 AM, mingge@ucar.edu wrote:

> Hi,
>
> Can anyone tell me how to make markers opaque ? I try to add some markers
> on a map by gsn_polymarker_ndc.
>
> Thanks
>
> Ming
>
>
>> Send ncl-talk mailing list submissions to
>> ncl-talk@ucar.edu
>>
>> To subscribe or unsubscribe via the World Wide Web, visit
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>> or, via email, send a message with subject or body 'help' to
>> ncl-talk-request@ucar.edu
>>
>> You can reach the person managing the list at
>> ncl-talk-owner@ucar.edu
>>
>> When replying, please edit your Subject line so it is more specific
>> than "Re: Contents of ncl-talk digest..."
>>
>>
>> Today's Topics:
>>
>> 1. Re: how to calculate seasonal means (Rob Nicholas)
>> 2. Re: Panel plot NDC placement (Oliver.Fuhrer@meteoswiss.ch)
>>
>>
>> ----------------------------------------------------------------------
>>
>> Message: 1
>> Date: Thu, 12 Aug 2010 09:51:37 -0700
>> From: Rob Nicholas <rnicholas@atmos.washington.edu>
>> Subject: Re: how to calculate seasonal means
>> To: ncl-talk@ucar.edu
>> Message-ID:
>> <AANLkTin5dmofAXzB6HH8caV6rti3kjkUbTKS1kPJd=ah@mail.gmail.com>
>> Content-Type: text/plain; charset="iso-8859-1"
>>
>> Vishali,
>>
>> I'm also not certain what you have in mind, but I'm guessing it's
>> something
>> like CDO's seasmean
>> operator<https://code.zmaw.de/embedded/cdo/current/cdo.html#x1-3650002.8.22>,
>> which computes a timeseries of three-month seasonal means
>> (DJF,MAM,JJA,SON)
>> from a timeseries (which could be 3-hourly, daily, monthly, whatever).
>> For
>> example, if you have a 10-year record of daily winds, the operator would
>> reduce it to a record of 40 timesteps, each of which contains a three
>> month
>> mean. (BTW, I would call what Dennis is describing the "annual cycle of
>> daily winds" but this may just be a function of the local dialect among
>> the
>> folks I work with.)
>>
>> I'm not aware that NCL has a comparable operator, but
>> month_to_seasonN()<http://www.ncl.ucar.edu/Document/Functions/Contributed/month_to_seasonN.shtml>should
>> work if you're starting with monthly data. For daily or
>> higher-time-resolution data, you'll probably need to iterate through your
>> timeseries, computing each three-month mean separately. How you do this
>> is
>> going to depend on the particular structure of of your data, the time
>> format, etc.
>>
>> ~Rob
>>
>>
>> --
>> Robert Nicholas
>> Department of Atmospheric Sciences
>> University of Washington, Box 351640
>> Seattle, WA 98195-1640
>> rnicholas@atmos.washington.edu
>> tel 206-438-3509, fax 206-543-0308
>> -------------- next part --------------
>> An HTML attachment was scrubbed...
>> URL:
>> http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20100812/e8a81b6d/attachment.html
>>
>> ------------------------------
>>
>> Message: 2
>> Date: Thu, 12 Aug 2010 19:09:37 +0200
>> From: <Oliver.Fuhrer@meteoswiss.ch>
>> Subject: Re: Panel plot NDC placement
>> To: <haley@ucar.edu>
>> Cc: ncl-talk@ucar.edu, Andre.Walser@meteoswiss.ch
>> Message-ID:
>> <19E843D905DC46438D74D64CAF1734090B2FEE11@zueex01.meteoswiss.ch>
>> Content-Type: text/plain; charset="us-ascii"
>>
>> Mary,
>>
>> Thanks for you comment. Basically I understand what you are saying. NCL
>> places the panel plot into the rectangle specified by
>> gsnPanel[Left/Right/Top/Bottom]. It does this by shrinking/expanding the
>> plot until it fits along _both_ dimensions. This will mean that the plot
>> fits snugly into the rectangle along one dimension. Along the other it
>> _centers_ the plot.
>>
>> Now, if I decrease the size of the rectangle in one direction until it
>> is the direction which constrains the size of the plot, of course it
>> will be aligned on both sides. What I was looking for was a resource
>> that would control the alignment along the _other_ dimension, where NCL
>> up to now makes the choice of centering the plot.
>>
>> I hope this was somehow clear...
>>
>> Kind regards,
>> Oli
>>
>>
>> ________________________________________
>>
>> Oliver Fuhrer
>> Numerical Models
>>
>> Federal Departement of Home Affairs FDHA
>> Federal Office of Meteorology and Climatology MeteoSwiss
>>
>> Kraehbuehlstrasse 58, P.O. Box 514, CH-8044 Zurich, Switzerland
>>
>> Tel. +41 44 256 93 59
>> Fax +41 44 256 92 78
>> oliver.fuhrer@meteoswiss.ch
>> www.meteoswiss.ch - First-hand information
>>
>>
>>
>>> -----Original Message-----
>>> From: Mary Haley [mailto:haley@ucar.edu]
>>> Sent: Donnerstag, 12. August 2010 18:22
>>> To: Fuhrer Oliver
>>> Cc: ncl-talk@ucar.edu; Walser Andre
>>> Subject: Re: Panel plot NDC placement
>>>
>>> Hi Oli,
>>>
>>> By default, gsn_panel will try to plot to a full
>>>
>>
>>
>> ------------------------------
>>
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk@ucar.edu
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>>
>> End of ncl-talk Digest, Vol 81, Issue 17
>> ****************************************
>>
>
>
> _______________________________________________
> 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 Mon Aug 16 14:16:37 2010

This archive was generated by hypermail 2.1.8 : Tue Aug 17 2010 - 15:33:24 MDT