Re: Panel plot error: color scheme | cnFillColors

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Mon Dec 03 2012 - 09:30:53 MST

Noel,

The first error is indicating that the array you are trying to plot is all one value. Plotting a constant field with NCL will give you errors if you are trying to give it an array of values for the contour levels.

When you say the data values are either 0 or 1 everywhere, do you mean that potentially one field can all be equal to 0, or all equal to 1, or do you mean the fields should be a mix of 0s and 1s? If you think your field (array) should be a mix of 0s and 1s, then you may want to print the min and max of your data to see what it looks like:

printMinMax(xPann85(0,it,i,:,:),0)

or

print(min(xPann85(0,it,i,:,:)) + "/" + max(xPann85(0,it,i,:,:))

The second error is likely occuring because the first plot was of a constant field, and hence gsn_panel can't retrieve contour levels in order to generate a labelbar.

BTW, to see an example of plotting values that are all 0s and 1s, see the first example (second frame) at:

http://www.ncl.ucar.edu/Applications/classification.shtml

--Mary

On Dec 3, 2012, at 8:56 AM, Noel Aloysius wrote:

> Hi NCL,
>
> I want to create a panelplot with 12 plots. The data values are either 0 or 1 everywhere. I want to create a raster plot with all 0s white and 1s red. When I try to run the script I get the following errors,
>
> 1. error type 1 within the do loop that creates the 12 plots
>
> warning:ContourPlotInitialize: scalar field is constant; ContourPlot not possible:[errno=1102] AND
> warning:ContourPlotSetValues: Data values out of range of levels set by EXPLICITLEVELS mode
>
> 2. error type 2 within the do loop that creates the panel
>
> fatal:ContourPlotGetValues: error copying cnFillColors GenArray AND
> fatal:["Execute.c":7743]:Execute: Error occurred at or near line 6464/7105 in file $NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl
> fatal:["Execute.c":7741]:Execute: Error occurred at or near line 2900 (gsn_panel(wks,plot(n:n+2),(/1,3/),pres1))
>
> I have attached the script.
> Thank you in advance for the help.
>
> Noel
>
>
> <panel_plot_test.ncl>_______________________________________________
> 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 Dec 3 09:31:03 2012

This archive was generated by hypermail 2.1.8 : Fri Dec 07 2012 - 13:30:06 MST