[gradsusr] color of undefine value

Charles Seman - NOAA Federal charles.seman at noaa.gov
Fri Nov 13 13:39:44 EST 2020


Mahakur,

Another possibility to shade missing (undef) values a light gray color.

The idea is to draw a light-gray filled rectangle over the plot area 
first, then plot your actual data over that.  Where there are missing 
(undef) points, GrADS does not update the background color, leaving the 
light-gray.  Reference: technique adapted from a post to the GrADS 
Listserv by Arindam Chakraborty <arch at CAOS.IISC.ERNET.IN> on Thu, 23 Jan 
2003 (a long time ago).

Try this:

  'set vpage 0.0 11.0 0.0 8.5' ;* landscape virtual page
  'set parea 1.0  9.0 1.0 7.5' ;* to put cbar along right side of plot

* draw the light-gray background

  'set grads off'   ;* if desired
  'set gxout shaded'
  'd yourvar'
  'q gxinfo'
   xlin = sublin(result,3)
   ylin = sublin(result,4)
   xl = subwrd(xlin,4)
   xh = subwrd(xlin,6)
   yl = subwrd(ylin,4)
   yh = subwrd(ylin,6)
  'set rgb 99 220 220 220'
  'set line 99'
  'draw recf 'xl' 'yl' 'xh' 'yh

* draw the plot

  'set grads off'   ;* if desired
  'set gxout shaded'

* if desired, set clevs, ccols, etc here

  'd yourvar'
  'run cbar.gs'

Hope it helps,
Chuck

On 11/13/20 12:34 PM, James T. Potemra wrote:
> Mahakur,
> 
> If you are reading from a local control file, you can change the missing 
> value to something else, then set the specific color for that value.
> 
> Jim
> 
> On 11/13/20 6:56 AM, Jeff Duda wrote:
>> Undefined points are shaded whatever the background color is. But you 
>> can change the background color using either 'set background ' or 'set 
>> display color ...'
>>
>> Jeff Duda
>>
>> On Fri, Nov 13, 2020 at 7:24 AM M.Mahakur <mmahakur at tropmet.res.in 
>> <mailto:mmahakur at tropmet.res.in>> wrote:
>>
>>     Dear All,
>>
>>     Why can I change the color of undefine points from its background
>>     color?
>>     In a grey shades plot the undefine points becoming white and
>>     making the figure noisy. Can I give it to some grayish color and how?
>>
>>     With Thanks and Regards,
>>     Mahakur
>>     _______________________________________________
>>     gradsusr mailing list
>>     gradsusr at gradsusr.org <mailto:gradsusr at gradsusr.org>
>>     http://gradsusr.org/mailman/listinfo/gradsusr
>>     <http://gradsusr.org/mailman/listinfo/gradsusr>
>>
>>
>>
>> -- 
>> Jeff Duda, Research Scientist
>> University of Colorado Boulder
>> Cooperative Institute for Research in Environmental Sciences
>> NOAA/OAR/ESRL/Global Systems Laboratory
>> Boulder, CO
>>
>> _______________________________________________
>> gradsusr mailing list
>> gradsusr at gradsusr.org
>> http://gradsusr.org/mailman/listinfo/gradsusr
> 
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
> 

-- 

Please note that Charles.Seman at noaa.gov should be considered my NOAA
email address, not cjs at gfdl.noaa.gov.

********************************************************************
  Charles Seman                                Charles.Seman at noaa.gov
  U.S. Department of Commerce / NOAA / OAR
  Geophysical Fluid Dynamics Laboratory
  201 Forrestal Road                            voice: (609) 452-6547
  Princeton, NJ  08540-6649                       fax: (609) 987-5063
********************************************************************

"The contents of this message are mine personally and do not reflect any
official or unofficial position of the United States Federal Government,
the United States Department of Commerce, or NOAA."


More information about the gradsusr mailing list