Re: Single plot overlaid on multiple base plots

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Wed Dec 11 2013 - 08:04:14 MST

Try using NhlRemoveOverlay to remove the overlaid plot before you overlay it again. This allows you to use "plot A" multiple times:

  map1 = gsn_csm_map(wks,mpres)
  map2 = gsn_csm_map(wks,mpres)

  plotA = gsn_csm_contour(wks,temp,cnres)

  overlay(map1,plotA)
  draw(map1)
  frame(wks)

;---Remove plotA from map1 before overlaying it again
  NhlRemoveOverlay(map1,plotA,False)
  overlay(map2,plotA)
  draw(map2)
  frame(wks)

-Mary

On Dec 10, 2013, at 6:06 PM, Li Dong <dongli@lasg.iap.ac.cn> wrote:

> Dear Mary,
>
> Thank you for help! I have tried your solution, but it still gives me the same error. I am going to speed up the plotting of A.
>
> Best,
>
> Li
>
> On 2013年12月11日, at 上午12:11, Mary Haley <haley@ucar.edu> wrote:
>
>> Hi Li,
>>
>> Once you overlay a plot onto another plot using "overlay", you cannot overlay it again on other plots.
>>
>> If you need to overlay "A" multiple times, you can try making a copy of it:
>>
>> plotB = plotA
>> plotC = plotA
>>
>> overlay(plotBase1, plotA)
>> overlay(plotBase2,plotB)
>> overlay(plotBase3,plotC)
>>
>> etc.
>>
>> --Mary
>>
>> On Dec 9, 2013, at 8:37 PM, Li Dong <dongli@lasg.iap.ac.cn> wrote:
>>
>>> Dear all,
>>>
>>> I have a plot (call it A) that is used to be overlaid on multiple base plots, because A is plotted so slowly that I would like just plot it once and reuse it. But I encountered the error:
>>>
>>> fatal:NhlAddOverlay: tranform is already an annotation or overlay: 9
>>>
>>> and only the first base plot has A overlaid.
>>>
>>> How could I achieve this? Thank you!
>>>
>>> Best regards,
>>>
>>> Li
>>> _______________________________________________
>>> 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

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Dec 11 08:04:25 2013

This archive was generated by hypermail 2.1.8 : Fri Dec 13 2013 - 11:39:30 MST