[ncl-talk] colorbar_and_title_not_showing
Mary Haley
haley at ucar.edu
Mon Jun 13 08:25:16 MDT 2016
I think the problem is that you set gsnMaximize to True for the map plot,
so NCL maximized the size of the map plot. Then, when the contour plot
with the labelbar on the bottom got added to this, there was no room left
for the labelbar.
My suggestion is to try setting gsnMaxmize to True for the plot that takes
up the most space on your page, which will be your filled contour plot.
Another suggestion is to try maximize_output:
http://www.ncl.ucar.edu/Document/Graphics/Interfaces/maximize_output.shtml
--Mary
On Sat, Jun 11, 2016 at 1:03 PM, Kunal Bali <kunal.bali9 at gmail.com> wrote:
> Dear NCL users,
>
> I plotted the overlay map, in that the colorbar is coming properly and
> title is also missing.
>
> Could you please let me know the missing point
> The script is written below
>
> BR = a->BRFLUXV(26,:,:)
> GPH = a1->H(26,0,:,:)
> u = a2->uwnd(114,4,:,:)
> v = a2->vwnd(114,4,:,:)
> ;---Open workstation and change color map
>
> wks_type = "pdf"
> ;wks_type at wkPaperSize = "A4"
> wks = gsn_open_wks(wks_type,"figure")
>
> ;;create plots;;
>
> ; gsn_define_colormap(wks,"BkBlAqGrYeOrReViWh200")
> res = True
> res at gsnDraw = False
> res at gsnFrame = False
> res at gsnMaximize = True
> res at tmXTOn = False
> res at tmYROn = False
> res at gsnLeftString = ""
> res at gsnRightString = ""
>
>
> ;;set map;;
> mpres = res
> mpres at mpDataSetName = "Earth..4"
> mpres at mpDataBaseVersion = "MediumRes"
> mpres at mpOutlineOn = True
> mpres at mpOutlineSpecifiers =
> (/"india","nepal","china"/)
> mpres at mpGeophysicalLineThicknessF = 2
> mpres at mpNationalLineThicknessF = 2
> mpres at mpFillDrawOrder = "PostDraw"
> mpres at mpFillOn = True
> mpres at mpMaskAreaSpecifiers =
> (/"india","india","nepal","china"/)
>
>
> ;;set area;;
> mpres at mpMinLonF = 65.0
> mpres at mpMaxLonF = 98.0
> mpres at mpMinLatF = 5.0
> mpres at mpMaxLatF = 38.0
>
> ;;set contour;;
> cnres = res
> cnres at cnFillDrawOrder = "PreDraw"
> cnres at cnFillOn = True
> cnres at cnLinesOn = False
> cnres at pmLabelBarWidthF = 0.4
> cnres at pmLabelBarHeightF = 0.09
> cnres at pmLabelBarOrthogonalPosF = 0.1
> cnres at lbLabelFontHeightF = 0.009
> cnres at lbLabelAngleF = 45
> cnres at tiMainString = "26 April 2016 @700hpa"
> cnres at cnLevelSelectionMode = "ExplicitLevels" ; set explicit
> contour levels
> cnres at cnLevels = (/0, 1e-06, 2e-06, 3e-06, 4e-06,
> 5e-06, 7e-06, 8e-06, 9e-06/)
> cnres at cnFillPalette = "WhBlGrYeRe"
>
>
> resL = res
> resL at cnFillOn = False ; turn on contour fill
> resL at cnLinesOn = True ; turn off contour lines
> resL at cnLineLabelsOn = True ; turn off line labels
> resL at cnLineThicknessF = 3.
> resL at cnLineColor = "red"
>
>
>
> ;;set vector;;
> res_vc = res
> res_vc at vcGlyphStyle = "LineArrow"
> res_vc at vcLineArrowThicknessF = 0.01
> res_vc at vcMinDistanceF = 0.001
> res_vc at vcRefLengthF = 0.085
>
> res_vc at vcRefAnnoOn = True
> res_vc at vcRefAnnoString2On = False
> res_vc at vcRefAnnoPerimOn = False
> res_vc at vcRefAnnoOrthogonalPosF = -0.12
> res_vc at vcRefAnnoParallelPosF = 0.999
> res_vc at vcRefAnnoBackgroundColor = "Purple"
> res_vc at vcVectorDrawOrder = "PostDraw"
> res_vc at gsnRightString = "Wind"
>
> ;;plot;;
> map = gsn_csm_map(wks,mpres)
> bc = gsn_csm_contour(wks,BR,cnres)
> geopot = gsn_csm_contour(wks,GPH,resL)
> vector = gsn_csm_vector(wks,v,u,res_vc)
>
>
> ;;overlay filled contours and vectors on the map;;
> overlay(map,bc)
> overlay(map,vector)
> overlay(map,geopot)
>
>
> ;;drawing "map" will draw everything: map, contours, vectors, and text;;
> draw(map)
> frame(wks)
> end
>
>
>
>
> Regards
> Kunal Bali
> Research Scholar
>
>
>
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160613/9372d2c4/attachment.html
More information about the ncl-talk
mailing list