Re: Add markers or curves to existing xy2 plot array

From: Wenshan Wang <wenshanw_at_nyahnyahspammersnyahnyah>
Date: Thu Jul 17 2014 - 11:53:09 MDT

Hi Karin,

Thank you very much for your help.

I mean on my left axis it is temperature, on the same plot but right axis
it is pressure.
I want to add temperature markers to the left axis and pressure markers to
the right axis.

If my plot is scalar, it is easy. just:
dum1 = gsn_add_polymarker(wks,plot,x,temperature,res1)
dum2 = gsn_add_polymarker(wks,*plot@xy2*,x,pressure,res1)

But if plot is an array, I don't how to do it.
I will write a sample script today.

Thank you!

Best,
Wenshan
---------------------------------------------------------------------------=
---
Graduate Student Researcher
Earth System Science
University of California, Irvine


On Thu, Jul 17, 2014 at 12:47 AM, Karin Meier-Fleischer <
meier-fleischer@dkrz.de> wrote:

> Hi Wenshan,
>
> ok, let me see if I understand it right. You want to create xy2 plots and
> add 2 marker to
> each single plot. Within a loop you have to be sure that the names of the
> variables (dum_left,
> dum_right) containing the graphical information of the marker are unique.
>
> do i=0,n
> plot(i) = gsn_csm_xy2(...)
> *dum_left* = unique_string("markl")
> *plot1*@*$dum_left$* = gsn_add_polymarker(wks,plot(i),x,y1,res1)
> *dum_right* = unique_string("markr")
> *plot1*@*$dum_right$* = gsn_add_polymarker(wks,plot(i),x,y2,res1)
> end do
>
> Hope this helps. If not, please send the script and your data (if
> possible), because it is very
> difficult to help without knowing it.
>
> Bye,
> Karin
>
> Am 17.07.14 06:36, schrieb Wenshan Wang:
>
> Hi Karin,
>
> Which one exactly do you mean?
> Sorry I didn't see any one that can solve my problem here.
>
> Let me see if I can explain my situation better.
> I have several panels on one page. On each panel, the XY plot has two
> different y-axes.
> I use:
> do i = 0, n
> plot(i) = gsn_csm_xy2(...)
> end do
>
> Then I want to add markers to each panel on both y-axes.
> Basically, I want something like
> 1 do i = 0, n
> 2 plot(i) = gsn_csm_xy2(...)
> 3 dum_left(i) = gsn_add_polymarker(wks, plot(i), x, y1, res1)
> 4 dum_right(i) = gsn_add_polymarker(wks, *plot(i)@xy2*, x, y2, res2)
> 5 end do
>
> but of course, line 4 is not right in syntax.
> I was wondering whether there is a way to do so.
>
> Thank you very much for your time!
>
> Best,
> Wenshan
>
> -------------------------------------------------------------------------=
-----
> Graduate Student Researcher
> Earth System Science
> University of California, Irvine
>
>
> On Wed, Jul 16, 2014 at 2:19 PM, Karin Meier-Fleischer <
> meier-fleischer@dkrz.de> wrote:
>
>> Hi Wenshan,
>>
>> take a look at the examples of the gsn_add_polymarker page:
>>
>>
>> https://www.ncl.ucar.edu/Document/Graphics/Interfaces/gsn_add_polymarker=
.shtml
>>
>> Bye,
>> Karin
>>
>> Am 16.07.2014 um 22:51 schrieb Wenshan Wang <wenshanw@uci.edu>:
>>
>> Hi NCL users,
>>
>> I was wondering how to add markers or curves to an existing XY plot
>> with two different y/x axes.
>> I find how to do it with scaler plot from xy_25.ncl and xy_26.ncl:
>>
>> dum1 = gsn_add_polyline(wks,plot@xy2,time,p1,lnres)
>>
>> What if my plot is an array?
>> I tried plot(i)@xy2 or plot@xy2(i); but they didn't work, actually as I
>> expected.
>> So it there a way to complete this?
>>
>> Thank you!
>>
>> Best,
>> Wenshan
>>
>> ------------------------------------------------------------------------=
------
>> Graduate Student Researcher
>> Earth System Science
>> University of California, Irvine
>> _______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>>
>>
>>
>
> --
> Dipl. Geophys. Karin Meier-Fleischer
> Application Support, Visualization
>
> Deutsches Klimarechenzentrum GmbH E-Mail: meier-fleischer@dkrz.de
> Bundesstrasse 45a Internet: http://www.dkrz.de/
> 20146 Hamburg Phone: +49 (0)40 460094 126
> Germany Fax: +49 (0)40 460094 270
>
> Geschäftsführer: Prof. Dr. Thomas Ludwig
> Sitz der Gesellschaft: Hamburg
> Amtsgericht Hamburg HRB 39784
>
>

Received on Thu Jul 17 05:59:56 2014

This archive was generated by hypermail 2.1.8 : Fri Aug 01 2014 - 15:10:55 MDT