plot [message #7831] |
Fri, 10 January 1997 00:00  |
collier
Messages: 2 Registered: January 1997
|
Junior Member |
|
|
Hi there,
IDL is new to me. Recently I tried to generate a filled contour plot
with labels on southern hemisphere by using map_set and contour
(I am using Idl v4.0.1 on a sgi workstation) such as the following. By
default without c_colors, Idl will fill the areas with less grid values by
darker grey colors, with larger values lighter. But idl doesn't fill
all the hemisphere leaving many parts of area white. This is confusing
and misleading, since white filling (actually some of them not filled at all)
means large grid values. I also tried by specifying c_colors to all
contours (see below) but to no avail. For the same data, by using
NCAR graphics one can produce a very good smoothly, continusly shaded,
labeled contours on the hemisphere.
Can anybody tell me how to do this by Idl? (I like using Idl, because
it has good mathematical and statistical functions).
If I change /fill into /cell_fill in the fillowing code as suggested by
the User's Guide P19-14, there will be no filling at all, why?
The max. Nlevels is 29. is there a way of increasing this?
; use Polar Stereographic Projection
!P.FONT=0
map_set, -90,0,0, /stereo,limit=[-90,-180,0,180],title=tit
; contour, dats,los,las,nlevels=25,c_charsize=1.0,/overplot,/fill
contour, dats,los,las,nlevels=25,c_charsize=1.0,/overplot,/fill, $
c_colors=[7*255,240,210,180,150,120,90,12*60]
contour, dats,los,las,nlevels=25,c_charsize=1.0,/follow,/overplot
map_continents, mlinethick=2
map_grid, latdel=30,londel=30,glinethick=2,lonlab=0
I will be very grateful if someone can help me on these questions.
Thanks in advance.
Mozheng Wei
--------------------------------------------------
CSIRO Division of Atmospheric Research
PMB 1, Aspendale
Victoria 3195, Australia
Voice: +61-3-9239-4415; Fax: +61-3-9239-4444
E-mail: mzw@dar.csiro.au
--------------------------------------------------
|
|
|
Re: plot [message #37061 is a reply to message #7831] |
Thu, 20 November 2003 05:52   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Steve writes:
> I have a simple question. I have a plot, and I would like that x label
> would not write all number (e.x. 33,34,35,36,37,...) in order to not
> overwhelm too much my plot. Is there any command to set the interval
> of number written (e.x. 33,35,37, ...) without changing the range of
> my plot?
How about this function:
FUNCTION EveryOther, axis, index, value
IF (index MOD 2) EQ 0 THEN $
RETURN, "" ELSE $
RETURN, String(value, Format='(I2)')
END
Then,
data = Findgen(11)
Plot, data, XTicks=10 ; Too many numbers!
Plot, data, XTicks=10, XTickformat='EveryOther'
Cheers,
David
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|
|
Re: plot [message #68489 is a reply to message #7831] |
Fri, 30 October 2009 13:57   |
pgrigis
Messages: 436 Registered: September 2007
|
Senior Member |
|
|
On Oct 30, 4:47 pm, David Fanning <n...@dfanning.com> wrote:
> Paolo writes:
>> Oh yes - you are right - so what is it exactly
>> that the OP is looking for? A definition of the
>> problem might help here instead of funny looking
>> plots...
>
> The OP is looking for a unique set of lines that
> connect "important points" in the scatterplot. As
> far as I can tell, such points can only be determined
> by inspection, but who knows. ;-)
Ah - that explains why I was confused - I may go as far
as to say that random sampling of the important points
comes to mind as a viable strategy too, and it has the
additional advantage of providing each plot with a
unique look :)
Ciao,
Paolo
>
> Cheers,
>
> David
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
|
Re: plot [message #68492 is a reply to message #7831] |
Fri, 30 October 2009 12:58   |
pgrigis
Messages: 436 Registered: September 2007
|
Senior Member |
|
|
On Oct 30, 3:39 pm, David Fanning <n...@dfanning.com> wrote:
> Paolo writes:
>> Compute the Delauney triangulation
>> of your points (IDL function triangulate)
>> and plot the boundary.
>
>> triangulate,x,y,tri,boundary
>
> Well, we seem to be lost. That is the same
> convex hull we saw before and rejected. Didn't
> anyone bring the GPS!? :-(
Oh yes - you are right - so what is it exactly
that the OP is looking for? A definition of the
problem might help here instead of funny looking
plots...
Ciao,
Paolo
>
> Cheers,
>
> David
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
|
Re: plot [message #68495 is a reply to message #7831] |
Fri, 30 October 2009 12:32   |
pgrigis
Messages: 436 Registered: September 2007
|
Senior Member |
|
|
On Oct 30, 12:23 pm, bing999 <thibaultga...@gmail.com> wrote:
> No, i don't want the contour to be based on the weight of the points,
> neither set the important points by myself ( i want to do it
> automatically for several plots...)
>
> Going back to the sketch :) :
>
> P
> PaP
> PaaP
> PaaaP
> PaaaaaP
> PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP
>
> I just want the contour to connect all the points on the very left,
> right, top and bottom, that is to say, all the P points = the
> surrounding points actually.
>
> Cheers
Compute the Delauney triangulation
of your points (IDL function triangulate)
and plot the boundary.
triangulate,x,y,tri,boundary
Ciao,
Paolo
|
|
|
Re: plot [message #68496 is a reply to message #7831] |
Fri, 30 October 2009 11:53   |
R.G.Stockwell
Messages: 163 Registered: October 2004
|
Senior Member |
|
|
"David Fanning" <news@dfanning.com> wrote in message
news:MPG.2554c354dc93878b98a7a8@news.giganews.com...
> bing999 writes:
>
>> No, i don't want the contour to be based on the weight of the points,
>> neither set the important points by myself ( i want to do it
>> automatically for several plots...)
>>
>> Going back to the sketch :) :
>>
>> P
>> PaP
>> PaaP
>> PaaaP
>> PaaaaaP
>> PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP
>>
>> I just want the contour to connect all the points on the very left,
>> right, top and bottom, that is to say, all the P points = the
>> surrounding points actually.
how about:
a = fltarr(10,10)
a[5,5] = 1
a[4:6,4] = 1
a[3:7,3] = 1
a[2:8,2] = 1
contour,a,nlevels=1
end
cheers,
bob
|
|
|
|
Re: plot [message #68500 is a reply to message #7831] |
Fri, 30 October 2009 09:33   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
bing999 writes:
> No, i don't want the contour to be based on the weight of the points,
> neither set the important points by myself ( i want to do it
> automatically for several plots...)
>
> Going back to the sketch :) :
>
> P
> PaP
> PaaP
> PaaaP
> PaaaaaP
> PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP
>
> I just want the contour to connect all the points on the very left,
> right, top and bottom, that is to say, all the P points = the
> surrounding points actually.
I know what you want. I'm just saying "Good luck
with that!" :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
|
Re: plot [message #68503 is a reply to message #7831] |
Fri, 30 October 2009 08:01   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
bing999 writes:
> Yes, thank you, thats it.
> Nevertheless, it is not accurate enough for what i want... The lines
> it draws connect "extreme" points and then do not pass by all
> "important" points.
> Clearly, the problem is as follows:
>
> T
> a
> aa
> aaa
> Zaaaaa
> Paaaaaaaaaaaaaaaaaaaaaaaaaaaaa
>
> with convex_hull.pro, a line connects directly the data points T to P
> whereas i would like to connect T to Z and then Z to P.
>
> Can it be done by modifying convex_hull.pro?
No, you will probably have to write the ImportantPointLocater
code yourself. Then just connect them with PLOTS. :-)
Although, after my shower, it occurs to me that what
you want *may* be an active contour in which you start
from the convex hull and "shrink" the contour based on
the weights of the points inside the convex hull.
http://www.dfanning.com/ip_tips/snakes.html
That would be quite a bit harder to write than an connect-the-dots
one-off for doing this interactively.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
|
|
|
|
Re: plot [message #68551 is a reply to message #7831] |
Tue, 03 November 2009 06:41   |
pgrigis
Messages: 436 Registered: September 2007
|
Senior Member |
|
|
On Nov 2, 6:25 pm, chris <rog...@googlemail.com> wrote:
> On 30 Okt., 17:23, bing999 <thibaultga...@gmail.com> wrote:
>
>
>
>> No, i don't want the contour to be based on the weight of the points,
>> neither set the important points by myself ( i want to do it
>> automatically for several plots...)
>
>> Going back to the sketch :) :
>
>> P
>> PaP
>> PaaP
>> PaaaP
>> PaaaaaP
>> PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP
>
>> I just want the contour to connect all the points on the very left,
>> right, top and bottom, that is to say, all the P points = the
>> surrounding points actually.
>
>> Cheers
>
> Hi,
> I think, you should apply some kind of linescan of rounded coordinates
> of your scatter gram, so you would determine the first "fit" and the
> last "fit" within a scanned line (column or row) with your rounded
> data points, determine for each fit within the line its nearest
> neighbour and store them. Then, you scan the next line and so on.
> After this you can connect your stored points by computing lines
> between the points, round the coordinates of the lines, sort the
> unique entries and store them and so on... Maybe it's a typical
> clipping problem which can be combined with some nearest neighbor
> approaches...
>
> Only my 2 cents
>
> Regards
>
> CR
OK - but is there a unique solution at all?
For instance, if you have these 5 points marked as X
X---X
--X--
X---X
What would be the desired polygon?
We already excluded the rectangular
convex hull.
Then what? We cut out one triangle to the center?
|\/|
|__|
Which one of the possible 4 then?
Or two triangles?
|\/|
|/\|
Or 3? Or 4?
I still think that the problem as stated
is ill-posed.
Ciao,
Paolo
|
|
|
Re: plot [message #68563 is a reply to message #68501] |
Mon, 02 November 2009 15:25   |
rogass
Messages: 200 Registered: April 2008
|
Senior Member |
|
|
On 30 Okt., 17:23, bing999 <thibaultga...@gmail.com> wrote:
> No, i don't want the contour to be based on the weight of the points,
> neither set the important points by myself ( i want to do it
> automatically for several plots...)
>
> Going back to the sketch :) :
>
> P
> PaP
> PaaP
> PaaaP
> PaaaaaP
> PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP
>
> I just want the contour to connect all the points on the very left,
> right, top and bottom, that is to say, all the P points = the
> surrounding points actually.
>
> Cheers
Hi,
I think, you should apply some kind of linescan of rounded coordinates
of your scatter gram, so you would determine the first "fit" and the
last "fit" within a scanned line (column or row) with your rounded
data points, determine for each fit within the line its nearest
neighbour and store them. Then, you scan the next line and so on.
After this you can connect your stored points by computing lines
between the points, round the coordinates of the lines, sort the
unique entries and store them and so on... Maybe it's a typical
clipping problem which can be combined with some nearest neighbor
approaches...
Only my 2 cents
Regards
CR
|
|
|
|
|
Re: plot [message #68872 is a reply to message #68668] |
Mon, 30 November 2009 23:56   |
rogass
Messages: 200 Registered: April 2008
|
Senior Member |
|
|
On 5 Nov., 12:35, greg <greg.a...@googlemail.com> wrote:
>> I still think that the problem as stated
>> is ill-posed.
>
> I agree. If you take away the convex condition (as the OP seems to
> ask), then whatever the set of points you can keep reducing the
> surrounding area until you get to zero. You'll get some kind of
> spidery thing, but it's probably not what he had in mind.
>
> Greg
Dear Bing,
like many times the routines from David Fanning will help. So the
following approach solved my own "concavity problem". Here it is -
hope it helps:
function get_mult_inds_from_mask,mask,verbose=verbose
;lines must be 255b, background must be 0b)
; denies dfanning's find_boundary
mask= bytscl(mask)
sz = size(mask,/dimensions)
l = label_region(mask)
h = histogram(l)
n = n_elements(h)
rois=replicate(ptr_new(),n-1)
if keyword_set(verbose) then window,/free,xsize=sz[0],ysize=sz[1]
for i=1,n-1 do begin
r=find_boundary(where(l eq i),xsize=sz[0],ysize=sz[1])
rois[i-1] = ptr_new(lonarr(2,n_elements(r)/2)+1)
*(rois[i-1]) = [[r],[r[*,0]]]
if keyword_set(verbose) then plots, r[0,*],r[1,*],color=255/i
endfor
return,rois
end
Regards
CR
p.s.: My personal favourite is Davids selectimage - it's superb and
I'm hoping that he will extend this routine to open ENVI files (also
spectra)....
|
|
|
Re: Plot [message #78559 is a reply to message #7831] |
Fri, 09 December 2011 12:44   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
David Fanning writes:
> The purpose of the Coyote Graphics routines, I guess
> I can't say this enough, is that they don't care a whit
> if you want to use black windows or white windows, or
> indexed color or decomposed color (although they LOVE
> decomposed color!) or the latest IDL or the oldest
> possible IDL, or you work on the display or exclusively
> in PostScript. They work every where and every time
> in every environment. Plus, they are about 100 times
> faster than any of the "new" alternatives.
I guess I'll put these books on sale for Christmas.
I'll advertise them as describing "just another
graphics system!" :-)
Cheers,
David
PS: OK, done. Everything in my store on-sale now!
http://www.idlcoyote.com/store/
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: Plot [message #78560 is a reply to message #7831] |
Fri, 09 December 2011 12:34   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Russell writes:
> And David's thing cgText is, if I may speak for him, just a
> wrapper to xyouts to get all the various keywords set in a more User-
> friendly way.
Well, among other things. :-)
The purpose of the Coyote Graphics routines, I guess
I can't say this enough, is that they don't care a whit
if you want to use black windows or white windows, or
indexed color or decomposed color (although they LOVE
decomposed color!) or the latest IDL or the oldest
possible IDL, or you work on the display or exclusively
in PostScript. They work every where and every time
in every environment. Plus, they are about 100 times
faster than any of the "new" alternatives.
And, they have features that the very latest of the
new graphics routines lack.
So, yes, it is a wrapper to the XYOutS command. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: Plot [message #78561 is a reply to message #7831] |
Fri, 09 December 2011 12:23   |
Russell[1]
Messages: 101 Registered: August 2011
|
Senior Member |
|
|
Yeah, that test I gave you was with IDL 8.1.
-R
xyouts is a very old (I think it's first generation IDL) way of doing
this. And David's thing cgText is, if I may speak for him, just a
wrapper to xyouts to get all the various keywords set in a more User-
friendly way. I learned IDL in a fairly closed-box environment, so
I'm used to reinventing the wheel ;).
On Dec 9, 2:46 pm, Dave Poreh <d.po...@gmail.com> wrote:
> On Dec 9, 10:28 am, Dave Poreh <d.po...@gmail.com> wrote:
>
>
>
>
>
>> On Dec 9, 8:09 am, Russell <rryan....@gmail.com> wrote:
>
>>> As always, David's got it. But just in case you're not familiar with
>>> the cg* stuff, then the old-fashioned xyouts will work just as well:
>
>>> x = [0, 35, 70, 140]
>>> y = [0, 196.7, 779.8, 37]
>>> vals=[12006,12507,13008,14010]
>
>>> names=string(vals,f='(I5)')
>
>>> plot,x,y,ps=2
>>> xyouts,x,y,vals
>
>>> -R
>
>>> PS, you can add all sorts of flags to xyouts to control where the text
>>> appears (such as alignment=alignment where 0<alignment<1, and a few
>>> others). Or you can get really fancy and measure the size of the text
>>> for the plot, and position it with respect to that size...
>
>>> On Dec 9, 10:06 am, Dave Poreh <d.po...@gmail.com> wrote:
>
>>>> Folks
>>>> hi,
>>>> I have a data like this and i want to plot column 1 (x) and column 2
>>>> (y) and column 3 as the name of the points on plot (like 12006, 12507
>>>> etc.). Could somebody help please?
>
>>>> 0 0 12006
>>>> 35 196.7 12507
>>>> 70 779.8 13008
>>>> 140 37 14010
>>>> .............
>>>> Cheers,
>>>> Dave
>
>> Thanks. both works very good.
>> Cheers,
>> Dave
>
> @ Dear Russell
> Does xyouts work with IDL 8.0 or not?
> Cheers,
> Dave
|
|
|
Re: Plot [message #78563 is a reply to message #7831] |
Fri, 09 December 2011 11:46   |
d.poreh
Messages: 406 Registered: October 2007
|
Senior Member |
|
|
On Dec 9, 10:28 am, Dave Poreh <d.po...@gmail.com> wrote:
> On Dec 9, 8:09 am, Russell <rryan....@gmail.com> wrote:
>
>
>
>
>
>
>
>
>
>> As always, David's got it. But just in case you're not familiar with
>> the cg* stuff, then the old-fashioned xyouts will work just as well:
>
>> x = [0, 35, 70, 140]
>> y = [0, 196.7, 779.8, 37]
>> vals=[12006,12507,13008,14010]
>
>> names=string(vals,f='(I5)')
>
>> plot,x,y,ps=2
>> xyouts,x,y,vals
>
>> -R
>
>> PS, you can add all sorts of flags to xyouts to control where the text
>> appears (such as alignment=alignment where 0<alignment<1, and a few
>> others). Or you can get really fancy and measure the size of the text
>> for the plot, and position it with respect to that size...
>
>> On Dec 9, 10:06 am, Dave Poreh <d.po...@gmail.com> wrote:
>
>>> Folks
>>> hi,
>>> I have a data like this and i want to plot column 1 (x) and column 2
>>> (y) and column 3 as the name of the points on plot (like 12006, 12507
>>> etc.). Could somebody help please?
>
>>> 0 0 12006
>>> 35 196.7 12507
>>> 70 779.8 13008
>>> 140 37 14010
>>> .............
>>> Cheers,
>>> Dave
>
> Thanks. both works very good.
> Cheers,
> Dave
@ Dear Russell
Does xyouts work with IDL 8.0 or not?
Cheers,
Dave
|
|
|
Re: Plot [message #78566 is a reply to message #7831] |
Fri, 09 December 2011 10:28   |
d.poreh
Messages: 406 Registered: October 2007
|
Senior Member |
|
|
On Dec 9, 8:09 am, Russell <rryan....@gmail.com> wrote:
> As always, David's got it. But just in case you're not familiar with
> the cg* stuff, then the old-fashioned xyouts will work just as well:
>
> x = [0, 35, 70, 140]
> y = [0, 196.7, 779.8, 37]
> vals=[12006,12507,13008,14010]
>
> names=string(vals,f='(I5)')
>
> plot,x,y,ps=2
> xyouts,x,y,vals
>
> -R
>
> PS, you can add all sorts of flags to xyouts to control where the text
> appears (such as alignment=alignment where 0<alignment<1, and a few
> others). Or you can get really fancy and measure the size of the text
> for the plot, and position it with respect to that size...
>
> On Dec 9, 10:06 am, Dave Poreh <d.po...@gmail.com> wrote:
>
>
>
>
>
>
>
>> Folks
>> hi,
>> I have a data like this and i want to plot column 1 (x) and column 2
>> (y) and column 3 as the name of the points on plot (like 12006, 12507
>> etc.). Could somebody help please?
>
>> 0 0 12006
>> 35 196.7 12507
>> 70 779.8 13008
>> 140 37 14010
>> .............
>> Cheers,
>> Dave
Thanks. both works very good.
Cheers,
Dave
|
|
|
Re: Plot [message #78567 is a reply to message #7831] |
Fri, 09 December 2011 08:09   |
Russell[1]
Messages: 101 Registered: August 2011
|
Senior Member |
|
|
As always, David's got it. But just in case you're not familiar with
the cg* stuff, then the old-fashioned xyouts will work just as well:
x = [0, 35, 70, 140]
y = [0, 196.7, 779.8, 37]
vals=[12006,12507,13008,14010]
names=string(vals,f='(I5)')
plot,x,y,ps=2
xyouts,x,y,vals
-R
PS, you can add all sorts of flags to xyouts to control where the text
appears (such as alignment=alignment where 0<alignment<1, and a few
others). Or you can get really fancy and measure the size of the text
for the plot, and position it with respect to that size...
On Dec 9, 10:06 am, Dave Poreh <d.po...@gmail.com> wrote:
> Folks
> hi,
> I have a data like this and i want to plot column 1 (x) and column 2
> (y) and column 3 as the name of the points on plot (like 12006, 12507
> etc.). Could somebody help please?
>
> 0 0 12006
> 35 196.7 12507
> 70 779.8 13008
> 140 37 14010
> .............
> Cheers,
> Dave
|
|
|
Re: Plot [message #78569 is a reply to message #7831] |
Fri, 09 December 2011 07:38   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Dave Poreh writes:
> I have a data like this and i want to plot column 1 (x) and column 2
> (y) and column 3 as the name of the points on plot (like 12006, 12507
> etc.). Could somebody help please?
>
> 0 0 12006
> 35 196.7 12507
> 70 779.8 13008
> 140 37 14010
x = [0, 35, 70, 140]
y = [0, 196.7, 779.8, 37]
names = StrTrim([12006,12507,13008,14010],2)
cgplot, x, y, PSym=2, color='red', SymSize=2, $
xrange=[-50, 200], yrange=[-200,1000]
n = Convert_Coord(x, y, /Data, /To_Normal)
xn = n[0,*]
yn = n[1,*]
for j=0,N_Elements(xn)-1 do begin
cgText, xn[j], yn[j]+0.025, names[j], align=0.5, $
/Normal, color='royal blue'
endfor
END
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: Plot [message #78725 is a reply to message #7831] |
Tue, 13 December 2011 10:20   |
d.poreh
Messages: 406 Registered: October 2007
|
Senior Member |
|
|
On Dec 13, 8:18 am, Mark Piper <mpi...@ittvis.com> wrote:
> On 12/10/2011 7:04 AM, Poreh wrote:
>
>> Mark, when i am running it gives me this error:
>> ps = symbol(x, y, sym_text=s, /data)
>> but still i have the plot.
>> Cheers,
>> Dave
>> ^
>> % Syntax error.
>
> Yes -- I'm sorry, this was my mistake; I was using the 8.2 tech preview
> (wherein SYMBOL is vectorized). In 8.1, use TEXT:
>
> x = [0, 35, 70, 140]
> y = [0, 196.7, 779.8, 37]
> s = string([12006, 12507, 13008, 14010])
>
> ; NG (IDL 8.1)
> p = plot(x, y)
> t = text(x, y, s, alignment='center', /data)
>
> mp
Thanks. how could we use points (beautiful one) instead of line here?
Cheers,
Dave
|
|
|
Re: Plot [message #78728 is a reply to message #7831] |
Tue, 13 December 2011 08:18   |
Mark Piper
Messages: 198 Registered: December 2009
|
Senior Member |
|
|
On 12/10/2011 7:04 AM, Poreh wrote:
> Mark, when i am running it gives me this error:
> ps = symbol(x, y, sym_text=s, /data)
> but still i have the plot.
> Cheers,
> Dave
> ^
> % Syntax error.
Yes -- I'm sorry, this was my mistake; I was using the 8.2 tech preview
(wherein SYMBOL is vectorized). In 8.1, use TEXT:
x = [0, 35, 70, 140]
y = [0, 196.7, 779.8, 37]
s = string([12006, 12507, 13008, 14010])
; NG (IDL 8.1)
p = plot(x, y)
t = text(x, y, s, alignment='center', /data)
mp
|
|
|
Re: Plot [message #78748 is a reply to message #7831] |
Sat, 10 December 2011 06:09   |
d.poreh
Messages: 406 Registered: October 2007
|
Senior Member |
|
|
On Dec 9, 4:11 pm, Jeremy Bailin <astroco...@gmail.com> wrote:
> On 12/9/11 3:06 PM, Dave Poreh wrote:
>
>> Folks
>> hi,
>> I have a data like this and i want to plot column 1 (x) and column 2
>> (y) and column 3 as the name of the points on plot (like 12006, 12507
>> etc.). Could somebody help please?
>
>> 0 0 12006
>> 35 196.7 12507
>> 70 779.8 13008
>> 140 37 14010
>> .............
>> Cheers,
>> Dave
>
> Try using XYOUTS.
>
> -Jeremy.
>
> .
Mark, when i am running it gives me this error:
ps = symbol(x, y, sym_text=s, /data)
^
% Syntax error.
but still i have the plot.
Cheers,
Dave
|
|
|
Re: Plot [message #78749 is a reply to message #7831] |
Sat, 10 December 2011 06:39   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Poreh writes:
>
> On Dec 9, 4:11 pm, Jeremy Bailin <astroco...@gmail.com> wrote:
>> On 12/9/11 3:06 PM, Dave Poreh wrote:
>>
>>> Folks
>>> hi,
>>> I have a data like this and i want to plot column 1 (x) and column 2
>>> (y) and column 3 as the name of the points on plot (like 12006, 12507
>>> etc.). Could somebody help please?
>>
>>> 0 0 12006
>>> 35 196.7 12507
>>> 70 779.8 13008
>>> 140 37 14010
>>> .............
>>> Cheers,
>>> Dave
>>
>> Try using XYOUTS.
>>
>> -Jeremy.
>>
>> .
> Mark, when i am running it gives me this error:
> ps = symbol(x, y, sym_text=s, /data)
> but still i have the plot.
> Cheers,
> Dave
> ^
> % Syntax error.
Here's what I get, but honestly, it's what I have
come to expect from function graphics. :-)
IDL> x = [0, 35, 70, 140]
IDL> y = [0, 196.7, 779.8, 37]
IDL> s = string([12006, 12507, 13008, 14010])
IDL>
IDL> ; NG (IDL 8.1)
IDL> p = plot(x, y)
IDL> ps = symbol(x, y, sym_text=s, /data)
% Loaded DLM: XML.
% SYMBOL: Incorrect number of arguments.
% Execution halted at: $MAIN$
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: Plot [message #78795 is a reply to message #78725] |
Mon, 19 December 2011 05:10   |
d.poreh
Messages: 406 Registered: October 2007
|
Senior Member |
|
|
On Dec 13, 7:20 pm, DavePoreh <d.po...@gmail.com> wrote:
> On Dec 13, 8:18 am, Mark Piper <mpi...@ittvis.com> wrote:
>
>
>
>
>
>
>
>
>
>> On 12/10/2011 7:04 AM, Poreh wrote:
>
>>> Mark, when i am running it gives me this error:
>>> ps = symbol(x, y, sym_text=s, /data)
>>> but still i have the plot.
>>> Cheers,
>>> Dave
>>> ^
>>> % Syntax error.
>
>> Yes -- I'm sorry, this was my mistake; I was using the 8.2 tech preview
>> (wherein SYMBOL is vectorized). In 8.1, use TEXT:
>
>> x = [0, 35, 70, 140]
>> y = [0, 196.7, 779.8, 37]
>> s = string([12006, 12507, 13008, 14010])
>
>> ; NG (IDL 8.1)
>> p = plot(x, y)
>> t = text(x, y, s, alignment='center', /data)
>
>> mp
>
> Thanks. how could we use points (beautiful one) instead of line here?
> Cheers,
> Dave
|
|
|
Re: plot [message #80938 is a reply to message #7831] |
Sat, 21 July 2012 12:59   |
d.poreh
Messages: 406 Registered: October 2007
|
Senior Member |
|
|
On Saturday, July 21, 2012 11:10:23 AM UTC-7, David Fanning wrote:
> dave poreh writes:
>
> > I did something like this, but still not working!!!
> >
> > pro read_several_png
> > cd,'D:\p\'
> > pathName="D:\p\"
> > List = findfile(pathName+"*.png")
> > nosFiles=N_ELEMENTS(List)
> > data = ptrarr(nosFiles)
> > outfile = STRARR(nosFiles)
> >
> > for i = 0, nosFiles - 1 do begin
> > x=read_png(list[i],rpal,gpal,bpal)
> > rootname = File_Basename(list[i], '.png')
> > data[i] = ptr_new(x)
> > endfor
> >
> > ps_start, pagetype='a4'
> > !p.multi=[0,3,9]
> > for j=0,26 do cgimage, data[j]
> > !p.multi=0
> > ps_end
> > end
>
> I would try dereferencing your pointer. :-)
>
> *data[j]
>
> Also, you may want more or less space between images.
> The MultiMargin keyword to cgImage can be used to
> adjust this to suit you.
>
> Cheers,
>
> David
>
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Thanks David, works well:-)
Cheers,
Dave
|
|
|
Re: plot [message #80939 is a reply to message #7831] |
Sat, 21 July 2012 11:10   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
dave poreh writes:
> I did something like this, but still not working!!!
>
> pro read_several_png
> cd,'D:\p\'
> pathName="D:\p\"
> List = findfile(pathName+"*.png")
> nosFiles=N_ELEMENTS(List)
> data = ptrarr(nosFiles)
> outfile = STRARR(nosFiles)
>
> for i = 0, nosFiles - 1 do begin
> x=read_png(list[i],rpal,gpal,bpal)
> rootname = File_Basename(list[i], '.png')
> data[i] = ptr_new(x)
> endfor
>
> ps_start, pagetype='a4'
> !p.multi=[0,3,9]
> for j=0,26 do cgimage, data[j]
> !p.multi=0
> ps_end
> end
I would try dereferencing your pointer. :-)
*data[j]
Also, you may want more or less space between images.
The MultiMargin keyword to cgImage can be used to
adjust this to suit you.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: plot [message #80940 is a reply to message #7831] |
Sat, 21 July 2012 11:01   |
d.poreh
Messages: 406 Registered: October 2007
|
Senior Member |
|
|
On Saturday, July 21, 2012 6:44:36 AM UTC-7, alx wrote:
> Le samedi 21 juillet 2012 11:04:13 UTC+2, dave poreh a écrit :
> > Folks
> > hi,
> > I need to plot 27 images in an A4 paper,with 9 rows and 3 columns. I have prepered these images in other software, but i need to plot it in IDL.
> > Will you pls give me some tips?
> > Cheers,
> > Dave
>
> for i=0,26 do img = image(images[i], LAYOUT=[9,3,i+1], CURRENT=(i gt 0))
>
> then,
> img.print
> or img.save, 'images.ps'
>
> you can furhter control margin, labels, legends, etc... by using keywords, both in 'image' and 'print' functions. Please read IDL documentation.
hi, David
I did something like this, but still not working!!!
pro read_several_png
cd,'D:\p\'
pathName="D:\p\"
List = findfile(pathName+"*.png")
nosFiles=N_ELEMENTS(List)
data = ptrarr(nosFiles)
outfile = STRARR(nosFiles)
for i = 0, nosFiles - 1 do begin
x=read_png(list[i],rpal,gpal,bpal)
rootname = File_Basename(list[i], '.png')
data[i] = ptr_new(x)
endfor
ps_start, pagetype='a4'
!p.multi=[0,3,9]
for j=0,26 do cgimage, data[j]
!p.multi=0
ps_end
end
|
|
|
Re: plot [message #80941 is a reply to message #7831] |
Sat, 21 July 2012 06:44   |
lecacheux.alain
Messages: 325 Registered: January 2008
|
Senior Member |
|
|
Le samedi 21 juillet 2012 11:04:13 UTC+2, dave poreh a écrit :
> Folks
> hi,
> I need to plot 27 images in an A4 paper,with 9 rows and 3 columns. I have prepered these images in other software, but i need to plot it in IDL.
> Will you pls give me some tips?
> Cheers,
> Dave
for i=0,26 do img = image(images[i], LAYOUT=[9,3,i+1], CURRENT=(i gt 0))
then,
img.print
or img.save, 'images.ps'
you can furhter control margin, labels, legends, etc... by using keywords, both in 'image' and 'print' functions. Please read IDL documentation.
|
|
|
Re: plot [message #80942 is a reply to message #7831] |
Sat, 21 July 2012 06:14   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
dave poreh writes:
> I need to plot 27 images in an A4 paper,with 9 rows and 3 columns. I have prepered these images in other software, but i need to plot it in IDL.
> Will you pls give me some tips?
>
ps_start, pagetype='a4'
!p.multi=[0,3,9]
for j=0,26 do cgimage, images[j]
!p.multi=0
ps_end
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: Plot [message #83222 is a reply to message #7831] |
Fri, 15 February 2013 05:52  |
d.poreh
Messages: 406 Registered: October 2007
|
Senior Member |
|
|
On Friday, February 15, 2013 2:40:23 PM UTC+1, David Fanning wrote:
> dave poreh writes:
>
>
>
>> I could not plot line x=0 in CGPlot,
>
>> cgPlot, x(0,*),x(1,*),psym=-46, symSize=2
>
>> cgPlot, !X.CRANGE,[0,0],/overplot
>
>>
>
>> this just plots line y=0 for me.
>
>
>
> Maybe you want this. :-)
>
>
>
> cgPlot, [0,0], !Y.CRange, /Overplot
>
>
>
> Cheers,
>
>
>
> David
>
>
>
>
>
>
>
>
>
> --
>
> David Fanning, Ph.D.
>
> Fanning Software Consulting, Inc.
>
> Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
>
> Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Yes, thanks,
Cheers,
Dave
|
|
|
Re: Plot [message #83223 is a reply to message #7831] |
Fri, 15 February 2013 05:40  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
dave poreh writes:
> I could not plot line x=0 in CGPlot,
> cgPlot, x(0,*),x(1,*),psym=-46, symSize=2
> cgPlot, !X.CRANGE,[0,0],/overplot
>
> this just plots line y=0 for me.
Maybe you want this. :-)
cgPlot, [0,0], !Y.CRange, /Overplot
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
|
|
|