Re: fill_bw_xy error

From: Jinqiang Chen <jcchen_at_nyahnyahspammersnyahnyah>
Date: Mon Aug 05 2013 - 10:57:51 MDT

Hi Mary, Thank you, and it's very helpful to know that gsn_csm_xy3 is not overlayable. basically I want to: 1. plot three curves with different colors, and we call it plot1; 2. overlay each curve's 1sigma uncertainty with filling color A but no xylineColors to plot1, which generates the plot2; 3. overlay each curve's 2 sigma uncertainty with filling color B but no xylineColors to plot2, which generates the final plot, plot3. I tried to use the way you proposed by creating three matrices, each composed of five single vectors,  representing its mean value, 1sigma upper-lower bound, 2sigma upper-lower boud, and use  gsn_csm_xy3 to plot, but in this case, I could only use one filling color. Do you have any suggestions?  Thanks Jinqiang -------------------- Jinqiang Chen Environmental Science and Engineering California Institute of Technology 1200 E. California Blvd.  mc: 131-24 Pasadena, CA  91125 Tel: +1 (626) 395-8704 Fax: +1 (626) 395-8535 email: jcchen_at_caltech.edu           jcchen_at_gps.caltech.edu http://www.gps.caltech.edu/~jcchen/ ________________________________ From: Mary Haley <haley_at_ucar.edu> To: Jinqiang Chen <jcchen_at_gps.caltech.edu> Cc: "ncl-talk_at_ucar.edu" <ncl-talk_at_ucar.edu> Sent: Monday, August 5, 2013 9:46 AM Subject: Re: [ncl-talk] fill_bw_xy error Jinqiang, I'm not sure what you mean by "use two different filling colors for two upper-lower boundaries". As far as I can tell from the modified script you sent me, you are using the same color for all the filled curves. Do you mean that you want a different fill color for the area above and below each curve, instead of one fill color for each region? Or do you mean for each set of three curves, you want a different fill color? Also, trying to overlay gsn_csm_xy3 on another gsn_csm_xy3 plot is not going to work, because gsn_csm_xy3 returns an object that already has overlaid plots on it, and you can't overlay plots that already have other plots overlaid on them. That's why you are getting the error: warning:TransformPreDraw: tfPolyDrawList element 0 is invalid When you see this kind of error, you should pay attention to it because it might mean you are losing some graphical information. If you can tell me what you are trying to accomplish by the "overlay" call (which in this case seems like you are overlay three line curves on two filled curves), then I might be able to suggest another way of doing it. --Mary On Aug 2, 2013, at 10:41 PM, Jinqiang Chen wrote: > Dear Mary, > > I tried your code and it works even though I got the same warning. However, if I want to use two different filling colors for two upper-lower boundaries (e.g., 1 sigma and 2 sigma interval), the code will become more complicated and I don't know how to code in your way. >  > Anyway, I changed your code in the way I did for my code. The error still exists and I couldn't draw the filling for the Y3 but Y3 does appear on the top though. > > Could you help me with this problem? Thanks! > > Kindly regards, > > Jinqiang Chen > > >  > -------------------- > Jinqiang Chen > Environmental Science and Engineering > California Institute of Technology > 1200 E. California Blvd. > mc: 131-24 > Pasadena, CA  91125 > Tel: +1 (626) 395-8704 > Fax: +1 (626) 395-8535 > email: jcchen_at_caltech.edu >          jcchen_at_gps.caltech.edu > http://www.gps.caltech.edu/~jcchen/ > > From: Mary Haley <haley_at_ucar.edu> > To: Jinqiang Chen <jcchen_at_gps.caltech.edu> > Cc: "ncl-talk_at_ucar.edu" <ncl-talk_at_ucar.edu> > Sent: Friday, August 2, 2013 10:42 AM > Subject: Re: fill_bw_xy error > > Hi Jinqiang, > > The code is a little complicated to debug without being able to actually run it.  I created an example that seems to work for me, although I do get a warning: > > (0)    fill_bw_xy: Error: If filling between two curves, one set must be 2D, and the other 1D. > > Can you try running the attached and let me know if it works for you? > > The weird thing that I don't quite understand is that the Y2 curve is appearing on top, even though the Y3 curve was added last. Is this the issue you are talking about? > > --Mary<fill_gsn_csm_xy3.png> > > On Jul 31, 2013, at 3:59 PM, Jinqiang Chen wrote: > > > Dear all, > > > > I have a problem with gsn_csm_xy3 when plotting three curves with their uncertainties. The error and part of my codes are as follows. I am also attaching the figure for reference. > > > > note: 1) the variables : global, co2, aer are 1D mean value, those with suffix _ext or _sigma are 2D, with the upper bound and lower bound of the 1D mean value. > >          2) The purpose of my figure is to draw three curves with their uncertainties, but the figure I plotted gave me just three curves with uncertainties of two of them. > >          3) I tried to switch the order of co2 and aer as well as those with suffix, it seems that only for the first two 2D parameters in the gsn_csm_xy3 filling can be done between the upper and lower bounds, leaving the third 2D vectors unfilled. > > > > Thank you very much! > > > > Jinqiang Chen > > > > ------------------------------beginning of error--------------------------------------- > > (0)    fill_bw_xy: Error: If filling between two curves, one set must be 2D, and the other 1D. > > (0)    fill_bw_xy: Error: If filling between two curves, one set must be 2D, and the other 1D. > > warning:TransformPreDraw: tfPolyDrawList element 0 is invalid > > warning:TransformPreDraw: tfPolyDrawList element 0 is invalid > > --------------------------------endding of error---------------------------------------- > > > > > > -------------------------------beginning of code-------------------------------------- > > res                    = True              ; plot mods desired > > res_at_gsnDraw            = False            ; don't draw yet > > res_at_gsnFrame          = False            ; don't advance frame yet > > > > res_at_vpHeightF    = 0.4              ; change aspect ratio of plot > > res_at_vpWidthF            = 0.6 > > > > res_at_trYMaxF            = 3.5 > > res_at_trYMinF            = -1.5 > > res_at_trXMinF              = 1860              ; set x-axis minimum > > res_at_trXMaxF              = 2100 > > > > res_at_xyMonoLineColor    = False            ; want colored lines > > res_at_xyLineColors      = (/"Blue"/) ; colors chosen > > res_at_xyLineThicknesses    = (/4./)      ; line thicknesses > > res_at_xyDashPatterns      = (/0./)      ; make all lines solid > > > > res_at_tiYAxisString        = "~F35~J~F~C"      ; add an axis title > > res_at_txFontHeightF        = 0.0195            ; change title font heights > > > > resL = True > > resL_at_gsnDraw            = False            ; don't draw yet > > resL_at_gsnFrame          = False            ; don't advance frame yet > > resL_at_trYMaxF            = 6.5 > > resL_at_trYMinF            = 0.0 > > resL_at_xyMonoLineColor    = False            ; want colored lines > > resL_at_xyLineColors      = (/"red"/) ; colors chosen > > resL_at_xyLineThicknesses  = (/4./)      ; line thicknesses > > resL_at_xyDashPatterns      = (/0./)      ; make all lines solid > > > > resR = True > > resR_at_gsnDraw            = False            ; don't draw yet > > resR_at_gsnFrame          = False            ; don't advance frame yet > > resR_at_trYMaxF            = 3.5 > > resR_at_trYMinF            = 0. > > resR_at_xyMonoLineColor    = False            ; want colored lines > > resR_at_xyLineColors      = (/"yellow"/) ; colors chosen > > resR_at_xyLineThicknesses  = (/4./)      ; line thicknesses > > resR_at_xyDashPatterns      = (/0./)      ; make all lines solid > > resL_at_amOrthogonalPosF = 0.62 > >  top_plot = gsn_csm_xy3 (wks,time,global, co2, aer,  res, resR, resL)      ; create line plot > > > > ; Create a plot with the area between both curves filled in blue. > >  delete(res_at_xyLineColors) > >  res_at_gsnXYFillColors = "lightskyblue1" > >  res_at_xyLineColor    = -1                          ; We don't want the line, so make it transparent. > >  delete(resL_at_xyLineColors) > >  resL_at_gsnXYFillColors = "lightskyblue1" > >  resL_at_xyLineColor    = -1                          ; We don't want the line, so make it transparent. > >  delete(resR_at_xyLineColors) > >  resR_at_gsnXYFillColors = "lightskyblue1" > >  resR_at_xyLineColor    = -1                          ; We don't want the line, so make it transparent. > >  mid_plot  = gsn_csm_xy3 (wks,time,global_sigma, co2_sigma, aer_sigma, res, resR, resL)  ; Create filled XY plot. > > ; Create a plot with the area between both curves filled in pink. > >  res_at_gsnXYFillColors = "azure3" > >  res_at_xyLineColor    = -1                          ; We don't want the line, so make it transparent. > >  resL_at_gsnXYFillColors = "azure3" > >  resL_at_xyLineColor    = -1                          ; We don't want the line, so make it transparent. > >  resR_at_gsnXYFillColors = "azure3" > >  resR_at_xyLineColor    = -1                          ; We don't want the line, so make it transparent. > >  bot_plot  = gsn_csm_xy3 (wks,time,global_ext,co2_ext,aer_ext,  res, resR, resL)  ; > >  overlay(bot_plot,mid_plot) > >  overlay(bot_plot,top_plot) > > -----------------------------------------endding of code------------------------------------------- > >  > > -------------------- > > Jinqiang Chen > > Environmental Science and Engineering > > California Institute of Technology > > 1200 E. California Blvd. > > mc: 131-24 > > Pasadena, CA  91125 > > Tel: +1 (626) 395-8704 > > Fax: +1 (626) 395-8535 > > email: jcchen_at_caltech.edu > >          jcchen_at_gps.caltech.edu > > http://www.gps.caltech.edu/~jcchen/ > > > > > > <global_tas.pdf>_______________________________________________ > > ncl-talk mailing list > > List instructions, subscriber options, unsubscribe: > > http://mailman.ucar.edu/mailman/listinfo/ncl-talk > > > <fill_gsn_csm_xy3.pdf><fill_gsn_csm_xy3.ncl.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 Aug 5 10:58:04 2013

This archive was generated by hypermail 2.1.8 : Wed Aug 07 2013 - 13:59:00 MDT