Using non-default symbols in IPLOT [message #75014] |
Mon, 14 February 2011 11:24  |
fgg
Messages: 67 Registered: April 2010
|
Member |
|
|
Hi,
I was wondering if I could use letters or numbers as the plotting
symbol (instead of SYM_INDEX = 1-8) that marks points in IPLOT? I
guess the answer has to do with SYM_OBJECT, but it's not clear to me
how to use it.
Thanks,
fgg
|
|
|
Re: Using non-default symbols in IPLOT [message #75075 is a reply to message #75014] |
Tue, 15 February 2011 13:18  |
penteado
Messages: 866 Registered: February 2018
|
Senior Member Administrator |
|
|
On Feb 15, 6:43 pm, fgg <fabioguimaraesgoncal...@gmail.com> wrote:
> I actually have a vector of strings, say:
>
> mysymbol=obj_new('idlgrtext',
> ['A','B','C',...],alignment=0.5,vertical_alignment=0.5,color
> =[255,0,0],
> font=obj_new('idlgrfont','courier',size=1000))
>
> and I'd like to plot the 1st string as the symbol for the 1st point,
> the 2nd string as the symbol for the 2nd point, and so on...
>
> Do I have to create a loop for that? Or there is a simpler way?
If there is, I would like to know it.
|
|
|
Re: Using non-default symbols in IPLOT [message #75077 is a reply to message #75014] |
Tue, 15 February 2011 12:43  |
fgg
Messages: 67 Registered: April 2010
|
Member |
|
|
One last question and I promise I'm done with this topic! :)
I actually have a vector of strings, say:
mysymbol=obj_new('idlgrtext',
['A','B','C',...],alignment=0.5,vertical_alignment=0.5,color
=[255,0,0],
font=obj_new('idlgrfont','courier',size=1000))
and I'd like to plot the 1st string as the symbol for the 1st point,
the 2nd string as the symbol for the 2nd point, and so on...
Do I have to create a loop for that? Or there is a simpler way?
If I do:
plot, x, y, sym_object=mysymbol, /scatter
with x and y having the same size as the vector of strings in
mysymbol, IDL plots all strings, superimposed, for every (x,y) pair.
|
|
|
Re: Using non-default symbols in IPLOT [message #75080 is a reply to message #75014] |
Tue, 15 February 2011 12:28  |
fgg
Messages: 67 Registered: April 2010
|
Member |
|
|
> You have IDL v7.x ?
>
> In IDL v8, the capability to use the object name as the constructor function was introduced. So along with the usual
>
> x = obj_new('myobject')
>
> you can also do
>
> x = myobject()
7.1.1. Thanks for clarifying, Paul.
|
|
|
Re: Using non-default symbols in IPLOT [message #75082 is a reply to message #75014] |
Tue, 15 February 2011 12:23  |
Paul Van Delst[1]
Messages: 1157 Registered: April 2002
|
Senior Member |
|
|
fgg wrote:
> On Feb 15, 11:10 am, Paulo Penteado <pp.pente...@gmail.com> wrote:
>> On Feb 14, 5:24 pm, fgg <fabioguimaraesgoncal...@gmail.com> wrote:
>>
>>> I was wondering if I could use letters or numbers as the plotting
>>> symbol (instead of SYM_INDEX = 1-8) that marks points in IPLOT? I
>>> guess the answer has to do with SYM_OBJECT, but it's not clear to me
>>> how to use it.
>> mysymbol=idlgrtext('A',alignment=0.5,vertical_alignment=0.5, color=[255,0,0] ,font=idlgrfont('courier',size=1000))
>> iplot,sin(dindgen(50)*!dpi/49d0),sym_object=mysymbol
>
> Paulo, I'm getting the following error when I try to create
> 'mysymbol':
>
> IDL>
> mysymbol=idlgrtext('A',alignment=0.5,vertical_alignment=0.5, color=[255,0,0] ,font=idlgrfont('courier',size=1000))
>
> mysymbol=idlgrtext('A',alignment=0.5,vertical_alignment=0.5, color=[255,0,0] ,font=idlgrfont('courier',size=1000))
> ^
> % Syntax error.
>
> Do you know why?
You have IDL v7.x ?
In IDL v8, the capability to use the object name as the constructor function was introduced. So along with the usual
x = obj_new('myobject')
you can also do
x = myobject()
|
|
|
Re: Using non-default symbols in IPLOT [message #75084 is a reply to message #75014] |
Tue, 15 February 2011 12:12  |
fgg
Messages: 67 Registered: April 2010
|
Member |
|
|
On Feb 15, 11:57 am, fgg <fabioguimaraesgoncal...@gmail.com> wrote:
> On Feb 15, 11:10 am, Paulo Penteado <pp.pente...@gmail.com> wrote:
>
>> On Feb 14, 5:24 pm, fgg <fabioguimaraesgoncal...@gmail.com> wrote:
>
>>> I was wondering if I could use letters or numbers as the plotting
>>> symbol (instead of SYM_INDEX = 1-8) that marks points in IPLOT? I
>>> guess the answer has to do with SYM_OBJECT, but it's not clear to me
>>> how to use it.
>
>> mysymbol=idlgrtext('A',alignment=0.5,vertical_alignment=0.5, color=[255,0,0] ,font=idlgrfont('courier',size=1000))
>> iplot,sin(dindgen(50)*!dpi/49d0),sym_object=mysymbol
>
> Paulo, I'm getting the following error when I try to create
> 'mysymbol':
>
> IDL>
> mysymbol=idlgrtext('A',alignment=0.5,vertical_alignment=0.5, color=[255,0,0] ,font=idlgrfont('courier',size=1000))
>
> mysymbol=idlgrtext('A',alignment=0.5,vertical_alignment=0.5, color=[255,0,0] ,font=idlgrfont('courier',size=1000))
> ^
> % Syntax error.
>
> Do you know why?
This seems to work:
mysymbol=obj_new('idlgrtext','A',alignment=0.5,vertical_alig nment=0.5,color=[255,0,0],
font=obj_new('idlgrfont','courier',size=1000))
|
|
|
Re: Using non-default symbols in IPLOT [message #75085 is a reply to message #75014] |
Tue, 15 February 2011 11:57  |
fgg
Messages: 67 Registered: April 2010
|
Member |
|
|
On Feb 15, 11:10 am, Paulo Penteado <pp.pente...@gmail.com> wrote:
> On Feb 14, 5:24 pm, fgg <fabioguimaraesgoncal...@gmail.com> wrote:
>
>> I was wondering if I could use letters or numbers as the plotting
>> symbol (instead of SYM_INDEX = 1-8) that marks points in IPLOT? I
>> guess the answer has to do with SYM_OBJECT, but it's not clear to me
>> how to use it.
>
> mysymbol=idlgrtext('A',alignment=0.5,vertical_alignment=0.5, color=[255,0,0] ,font=idlgrfont('courier',size=1000))
> iplot,sin(dindgen(50)*!dpi/49d0),sym_object=mysymbol
Paulo, I'm getting the following error when I try to create
'mysymbol':
IDL>
mysymbol=idlgrtext('A',alignment=0.5,vertical_alignment=0.5, color=[255,0,0] ,font=idlgrfont('courier',size=1000))
mysymbol=idlgrtext('A',alignment=0.5,vertical_alignment=0.5, color=[255,0,0] ,font=idlgrfont('courier',size=1000))
^
% Syntax error.
Do you know why?
|
|
|
Re: Using non-default symbols in IPLOT [message #75086 is a reply to message #75014] |
Tue, 15 February 2011 11:22  |
fgg
Messages: 67 Registered: April 2010
|
Member |
|
|
On Feb 15, 11:10 am, Paulo Penteado <pp.pente...@gmail.com> wrote:
> On Feb 14, 5:24 pm, fgg <fabioguimaraesgoncal...@gmail.com> wrote:
>
> mysymbol=idlgrtext('A',alignment=0.5,vertical_alignment=0.5, color=[255,0,0] ,font=idlgrfont('courier',size=1000))
> iplot,sin(dindgen(50)*!dpi/49d0),sym_object=mysymbol
Thanks, Paulo.
|
|
|
Re: Using non-default symbols in IPLOT [message #75087 is a reply to message #75014] |
Tue, 15 February 2011 11:10  |
penteado
Messages: 866 Registered: February 2018
|
Senior Member Administrator |
|
|
On Feb 14, 5:24 pm, fgg <fabioguimaraesgoncal...@gmail.com> wrote:
> I was wondering if I could use letters or numbers as the plotting
> symbol (instead of SYM_INDEX = 1-8) that marks points in IPLOT? I
> guess the answer has to do with SYM_OBJECT, but it's not clear to me
> how to use it.
mysymbol=idlgrtext('A',alignment=0.5,vertical_alignment=0.5, color=[255,0,0],font=idlgrfont('courier',size=1000))
iplot,sin(dindgen(50)*!dpi/49d0),sym_object=mysymbol
|
|
|
|