Problem with PLOT_OO ticks [message #3674] |
Mon, 06 March 1995 06:09  |
mallozzi
Messages: 60 Registered: August 1994
|
Member |
|
|
Hi all,
I have a routine that zooms in on a plot. If the x-axis, for axample, is
a log scale, and I zoom in to less than 1 decade, IDL spaces the tickmarks
logarithmically (as it should), but doesn't label any of them! If I
then set XTICKS manually, the tickmarks are evenly spaced on the axis,
resulting in weird values for the ticks.
PLOT needs to be fixed so that tickmarks are labeled automatically for
ranges less than 1 decade. In the meantime, does anyone have an easy
implementation to fix this? The set of routines is much too complicated
to go through and try to fix every plot by hand...
BTW, I tried this with IDL V3.5.1 and V3.6
Thanks,
mallozzi@ssl.msfc.nasa.gov
|
|
|
Re: problem with plot [message #56683 is a reply to message #3674] |
Mon, 12 November 2007 07:11   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
nakisa writes:
> I am new in IDL , I want to plot data which restored in txt file and
> plot by below code.
>
>
> pro test
> A_x=fltarr(1)
> A_y=fltarr(1)
> fn='F:\test.txt'
> openr,1,fn
> repeat begin
> readf,1,x,y
> ;A_x(*)=x
> ;A_y(*)=y
> plot,A_x,A_y
> endrep until eof(1)
> close,1
> ;plot ,A_x,A_y,PSYM=4,Title="test"
> END
>
>
> It runs ,but plot only a frame!! Can anybody say me where the error
> is
Oh, dear. How about something like this:
PRO test
datafile = 'F:\test.txt'
rows = File_Lines(datafile)
data = FltArr(2,rows)
OpenR, lun, datafile, /Get_LUN
ReadF, lun, data
Free_Lun, lun
x = Reform(data[0,*])
y = Reform(data[1,*])
Plot, x, y
END
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: problem with plot [message #56765 is a reply to message #56683] |
Tue, 13 November 2007 08:22  |
Allan Whiteford
Messages: 117 Registered: June 2006
|
Senior Member |
|
|
David Fanning wrote:
> nakisa writes:
>
>
>> I am new in IDL , I want to plot data which restored in txt file and
>> plot by below code.
>>
>>
>> pro test
>> A_x=fltarr(1)
>> A_y=fltarr(1)
>> fn='F:\test.txt'
>> openr,1,fn
>> repeat begin
>> readf,1,x,y
>> ;A_x(*)=x
>> ;A_y(*)=y
>> plot,A_x,A_y
>> endrep until eof(1)
>> close,1
>> ;plot ,A_x,A_y,PSYM=4,Title="test"
>> END
>>
>>
>> It runs ,but plot only a frame!! Can anybody say me where the error
>> is
>
>
> Oh, dear. How about something like this:
>
> PRO test
> datafile = 'F:\test.txt'
> rows = File_Lines(datafile)
> data = FltArr(2,rows)
> OpenR, lun, datafile, /Get_LUN
> ReadF, lun, data
> Free_Lun, lun
> x = Reform(data[0,*])
> y = Reform(data[1,*])
> Plot, x, y
> END
>
> Cheers,
>
> David
>
I'd prefer:
pro test
plot,((_=read_ascii("F:\test.txt"))).(0)[0,*],_.(0)[1,*]
end
but I'm not paid by the number of lines of code I write :).
In all seriousness, though, is there a reason to avoid read_ascii for
things like this or were you just trying to use as much of the original
structure as possible?
Thanks,
Allan
|
|
|
Re: problem with plot [message #56771 is a reply to message #56683] |
Mon, 12 November 2007 21:23  |
nakisa
Messages: 24 Registered: June 2007
|
Junior Member |
|
|
hi David
I use 5.4 version, and as far as i searching thorough internet ,
"file_lines" works in 5.6 version.
so i can't use it !!
nakisa
|
|
|