Re: Add diagonal 1:1 line in a plot? [message #53920] |
Tue, 08 May 2007 07:03 |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Mike writes:
>> OPlot, [-5, 10], [-5, 10]
>
> Be careful with this - the slope of the line depends on the plot range
> and aspect ratio and the ratios of those to the arguments to oplot.
> I've found that using
>
>> oplot, !x.crange, !x.crange
>
> more often produces correct plots.
I had to do an Internet search to see what he meant
by a 1:1 line, but it seemed to me that the actual
slope didn't matter in this case. It was the ratio
that was important.
But, in any case, it would probably be smart to
have a plot that had a 1:1 aspect ratio, if only so you
don't confuse the casual reader of your paper.
You could always use my ASPECT program for this
purpose:
PLOT, data, POSITION=Aspect(1.0)
You can find ASPECT here:
http://www.dfanning.com/programs/aspect.pro
Of course, you can have aspect ratios be whatever
you want them to be:
Plot, data, POSITION=Aspect(2.0/3.0)
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: Add diagonal 1:1 line in a plot? [message #53922 is a reply to message #53920] |
Tue, 08 May 2007 06:57  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
DirtyHarry writes:
> If you are visiting Korea someday, Just email me. I will introduce you
> the Soju, Korean style white wine (in my opinion!) You will love
> it...!!!
Oh, I may have to stop by for that! :-)
My focus at the moment, though, is on Spanish speaking
countries. I had a first yesterday. Someone sent me
an IDL problem by e-mail, written in Spanish. Not only
could I read the e-mail, but I was able to respond in
Spanish. (At least, I *think* it was Spanish. I had
to make a couple of words up.) Whatever it was, it
seemed to work. I have a note this morning that the
problem is solved! :-)
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: Add diagonal 1:1 line in a plot? [message #53923 is a reply to message #53922] |
Tue, 08 May 2007 06:54  |
Mike[2]
Messages: 99 Registered: December 2005
|
Member |
|
|
On May 7, 11:33 pm, David Fanning <n...@dfanning.com> wrote:
> OPlot, [-5, 10], [-5, 10]
Be careful with this - the slope of the line depends on the plot range
and aspect ratio and the ratios of those to the arguments to oplot.
I've found that using
> oplot, !x.crange, !x.crange
more often produces correct plots.
Mike
|
|
|
Re: Add diagonal 1:1 line in a plot? [message #53930 is a reply to message #53923] |
Mon, 07 May 2007 21:57  |
kim20026
Messages: 54 Registered: November 2006
|
Member |
|
|
Thanks a buuuunch!!!!!!!!! David!
If you are visiting Korea someday, Just email me. I will introduce you
the Soju, Korean style white wine (in my opinion!) You will love
it...!!!
Have a nice day!
Harry
|
|
|
Re: Add diagonal 1:1 line in a plot? [message #53933 is a reply to message #53930] |
Mon, 07 May 2007 20:33  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
DirtyHarry writes:
> Goodday, Everyone.
>
> I am writing a classical scientific paper comparing MODIS-retrieved
> data with ground measured data. I found several papers on this. Almost
> all of those papers have figures with 1:1 diagonal lines, and I want
> to draw this with IDL.
>
> I tried this way.
>
> pro OneOne ; Display 1:1 line
>
> device, decomposed=0, set_font='arial*24*bold'
> loadct, 30
>
> window, xsize=700, ysize=700
>
> readcol, 'dat.txt', nws, mod07, format='F, F'
> n=n_elements(nws)
>
> vsym, 24
> plot, nws, mod07, psym =2, title ='1:1 line - NWS vs MOD07', xtitle =
> 'NWS', ytitle = 'MOD07', xrange = [-5, 10], yrange = [-5, 10]
>
> end
>
> Now I got a plot with several dots. However, still I don't know how to
> add the diagonal 1:1 line. Please give me a suggestion. Thanks.
OPlot, [-5, 10], [-5, 10]
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.")
|
|
|