comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Plot problem
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: plot problem [message #80961 is a reply to message #39989] Sat, 28 July 2012 09:44 Go to previous messageGo to previous message
d.poreh is currently offline  d.poreh
Messages: 406
Registered: October 2007
Senior Member
On Saturday, July 28, 2012 2:31:57 AM UTC-7, alx wrote:
> Le samedi 28 juillet 2012 07:10:16 UTC+2, dave poreh a écrit :
>
>> On Friday, July 27, 2012 4:22:34 PM UTC-7, alx wrote:
>
>>
>
>>> Le vendredi 27 juillet 2012 18:22:28 UTC+2, dave poreh a écrit :
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> Works perfect. Thanks, just i need to pass a text for each graph:
>
>>
>
>>>
>
>>
>
>>>> !null = text(1,1, 'speed=',$\pm$ num2str, /data, font_size=12)
>
>>
>
>>>
>
>>
>
>>>> that stands for *speed= 10+- 0.2* for instance on each graph. Can you help pls.
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> Cheers,
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> Dave
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>> Try:
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>> IDL> pl = objarr(6)
>
>>
>
>>>
>
>>
>
>>> IDL> for i=0,5 do begin
>
>>
>
>>>
>
>>
>
>>> IDL> pl[i] = plot(/TEST, LAYOUT=[3,2,i+1], CURRENT=(i ne 0))
>
>>
>
>>>
>
>>
>
>>> IDL> !null = text(100, 0.8-0.05*i, 'text', /DATA, TARGET=pl[i])
>
>>
>
>>>
>
>>
>
>>> IDL> endfor
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>> Alain.
>
>>
>
>>
>
>>
>
>> Dear Alx
>
>>
>
>> It is not working for me! here is the code:
>
>>
>
>> pro GPS_text
>
>>
>
>> cd,'C:\Documents and Settings\Dave\Desktop'
>
>>
>
>> pathName="d:\p\"
>
>>
>
>> List = findfile(pathName+"*.dat")
>
>>
>
>> nosFiles=N_ELEMENTS(List)
>
>>
>
>> data = ptrarr(nosFiles)
>
>>
>
>> outfile = STRARR(nosFiles)
>
>>
>
>> p1=objarr(27)
>
>>
>
>> for i = 0, nosFiles - 1 do begin
>
>>
>
>> x=read_ascii(list[i],DATA_START=1)
>
>>
>
>> rootname = File_Basename(list[i], '.dat')
>
>>
>
>> data[i] = ptr_new(x)
>
>>
>
>> vert=(*data[i]).(0)
>
>>
>
>> p1[i]=plot(vert[0,*],vert[1,*],'ob', /SYM_FILLED, $
>
>>
>
>> SYM_SIZE=0.5,MARGIN=[0.1,0.2,0.0,0.05],layout=[3,9,i+1],/CUR RENT)
>
>>
>
>> fit=linfit(vert[0,*],vert[1,*],yfit=yfit)
>
>>
>
>>
>
>>
>
>> !null = text(100, 0.8-0.05*i, 'speed=', /DATA, font_size=12, TARGET=p1[i])
>
>>
>
>>
>
>>
>
>> p2= plot(vert[0,*],yfit , thick=2,color='red',xrange=[1998,2013],$
>
>>
>
>> /overplot, /SYM_FILLED, /undoc)
>
>>
>
>> print, fit, mean(vert[6,*])
>
>>
>
>>
>
>>
>
>> endfor
>
>>
>
>>
>
>>
>
>> end
>
>
>
> I cannot run your code to see what is not working, but I guess that the issue comes from using /OVERPLOT in the 'p2' statement. Indeed, the OVERPLOT keyword in NG does not work exactly like the oplot statement in DG: in particular, axis ranges and labeling are changed as needed.
>
> To ensure an exact overplotting in your case, I would suggest to modify the 'p2' statement as follows:
>
>
>
> p2 = plot(vert[0,*], yfit , thick=2, color='red', xrange=p1[i].xrange, $
>
> yrange=p1[i].yrange, /overplot, /SYM_FILLED, /undoc)
>
>
>
> and maybe add 'xrange=[1998,2013]' in the 'p1' statement.
>
>
>
> By the way, what means the '/undoc' keyword you are using in your plot statement ?
>
>
>
> Alain.

NO it is not working:-(
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to manipulate vectors by the index
Next Topic: Hardware suggestions for IDL/ENVI.

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 16:02:23 PDT 2025

Total time taken to generate the page: 0.00371 seconds