contour overplotting [message #75471] |
Mon, 14 March 2011 03:57  |
abc
Messages: 46 Registered: March 2011
|
Member |
|
|
Dear All,
I am having a small trouble in making contour over-
plotting . Here I am reading two different data set with different
values. I want to make a contour plot of the first data set and then
want to over plot the contour of the second data set with different
colors.
My question is that is it possible in IDL to overplot a contour plot
on another contour plot with different colors. if yes then how. And
if No then how I can overplot a contour plot on another contour plot
with the same colors.
Thanks in advance
readcol, 'A.txt',skipline=3,x,y,z,f='f,f,f'
readcol, 'B.txt',skipline=3,x1,y1,z1,f='f,f,f'
DEVICE,DECOMPOSED =0
window,xs=600,ys=700
loadct,27
tvlct,0,0,0,255
!p.charsize=1.5
!p.multi=[0,1,2]
;=========================================================== ========================
contour,x<0.005,y,z,/irregular,c_label=[1,1,1,1,1],nlevels=572,/xst,/
yst,/fill,Position=[0.1, 0.1, 0.9, 0.80]
contour,x<0.005,y,z,/
irregular,c_label=[1,1,1,1,1],level=[0.0009,0.0012,0.0017],$
c_charsize=1.0,c_color=[0,0,255,255],/over
;=========================================================== ========================
contour,x1<0.005,y1,z1,/irregular,c_label=[1,1,1,1],nlevels=100,/xst,/
yst,/fill
contour,x1<0.005,y1,z1,/
irregular,c_label=[1,1,1,1],level=[0.0012,0.0015,0.0018],$
c_charsize=1.0,c_color=[0,0,255,255],/over
colorbar, BOTTOM=4,DIVISIONS=5,FORMAT='(f6.4)', POSITION=[0.18, 0.9,
0.9, 0.95], $
MAX=0.005, MIN=MIN(chi2)
;=========================================================== ==================
end
|
|
|
Re: contour overplotting [message #75640 is a reply to message #75471] |
Tue, 15 March 2011 07:42  |
pgrigis
Messages: 436 Registered: September 2007
|
Senior Member |
|
|
On Mar 15, 8:56 am, David Fanning <n...@idlcoyote.com> wrote:
> abc writes:
>> I have read contour Plot chapter from your new book.
>> It is very helpful. But still I am not able to over-plot contours of
>> the second data set i.e x1,y1,z1 on my first data set i.e x,y,z with
>> different colors.
>> Actually my main aim is to find the point of intersection of these two
>> over plotted contour plots. I tried a lot but I don't know how to do
>> that.
>
> Well, I would do it something like this:
>
> data_1 = cgDemoData(2)
> x_1 = Scale_Vector(Findgen(41), 5, 20)
> y_1 = Scale_Vector(Findgen(41), 5, 20)
>
> data_2 = cgDemoData(3)
> x_2 = Scale_Vector(Findgen(41), 0, 12)
> y_2 = Scale_Vector(Findgen(41), 0, 12)
>
> cgLoadCt, 4, /Brewer, /Reverse
> cgContour, data_1, x_1, y_1, XRange=[0,20], $
> YRange=[0,20], /FILL, NLEVELS=12
> cgContour, data_1, x_1, y_1, XRange=[0,20], $
> YRange=[0,20], /OVERPLOT, NLEVELS=12
>
> cgLoadCt, 9, /Brewer, /Reverse
> cgContour, data_2, x_2, y_2, XRange=[0,20], $
> YRange=[0,20], /FILL, NLEVELS=12, /OVERPLOT
> cgContour, data_2, x_2, y_2, XRange=[0,20], $
> YRange=[0,20], /OVERPLOT, NLEVELS=12
>
> END
>
> You can see the result in this figure:
>
> http://www.idlcoyote.com/misc/double_contour.png
>
> 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.")
I wonder if he instead wanted to have something like:
loadct,0
tvlct,255,0,0,2
x=findgen(512)
xx=x#(x*0+1)
contour,xx
contour,transpose(xx),c_color=2,/noerase
?
Ciao,
Paolo
|
|
|
Re: contour overplotting [message #75645 is a reply to message #75471] |
Tue, 15 March 2011 05:56  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
abc writes:
> I have read contour Plot chapter from your new book.
> It is very helpful. But still I am not able to over-plot contours of
> the second data set i.e x1,y1,z1 on my first data set i.e x,y,z with
> different colors.
> Actually my main aim is to find the point of intersection of these two
> over plotted contour plots. I tried a lot but I don't know how to do
> that.
Well, I would do it something like this:
data_1 = cgDemoData(2)
x_1 = Scale_Vector(Findgen(41), 5, 20)
y_1 = Scale_Vector(Findgen(41), 5, 20)
data_2 = cgDemoData(3)
x_2 = Scale_Vector(Findgen(41), 0, 12)
y_2 = Scale_Vector(Findgen(41), 0, 12)
cgLoadCt, 4, /Brewer, /Reverse
cgContour, data_1, x_1, y_1, XRange=[0,20], $
YRange=[0,20], /FILL, NLEVELS=12
cgContour, data_1, x_1, y_1, XRange=[0,20], $
YRange=[0,20], /OVERPLOT, NLEVELS=12
cgLoadCt, 9, /Brewer, /Reverse
cgContour, data_2, x_2, y_2, XRange=[0,20], $
YRange=[0,20], /FILL, NLEVELS=12, /OVERPLOT
cgContour, data_2, x_2, y_2, XRange=[0,20], $
YRange=[0,20], /OVERPLOT, NLEVELS=12
END
You can see the result in this figure:
http://www.idlcoyote.com/misc/double_contour.png
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.")
|
|
|