wplot not zooming [message #93018] |
Mon, 11 April 2016 04:10  |
Sapna Mishra
Messages: 66 Registered: December 2015
|
Member |
|
|
Hi all,
In the following program I am not able to zoom in-out my plot:
pro pltdat4, file
Readcol,file,a,b,c,d
wplot,a,b
woplot,a,d,color=2
openw,3,'final.sh'
tt=''
Print,'Is it final?:'
Read,tt
wait,1
if (STRMATCH(tt, 'y', /FOLD_CASE) EQ 1) then begin
printf,3,format='(A,2x,A)', 'cp',file
endif
close,3
spawn, ' chmod +x final.sh'
return
end
However when I am simply doing
pro pltdat4, file
Readcol,file,a,b,c,d
wplot,a,b
woplot,a,d,color=2
return
end
I am able to zoom in-out my plot any solution???
|
|
|
Re: wplot not zooming [message #93025 is a reply to message #93018] |
Tue, 12 April 2016 09:03  |
Paul Van Delst[1]
Messages: 1157 Registered: April 2002
|
Senior Member |
|
|
On 04/11/16 07:10, Sapna Mishra wrote:
> Hi all,
>
> In the following program I am not able to zoom in-out my plot:
>
> pro pltdat4, file
>
> Readcol,file,a,b,c,d
> wplot,a,b
> woplot,a,d,color=2
>
> openw,3,'final.sh'
> tt=''
> Print,'Is it final?:'
> Read,tt
> wait,1
> if (STRMATCH(tt, 'y', /FOLD_CASE) EQ 1) then begin
> printf,3,format='(A,2x,A)', 'cp',file
> endif
> close,3
> spawn, ' chmod +x final.sh'
>
> return
> end
>
> However when I am simply doing
>
> pro pltdat4, file
> Readcol,file,a,b,c,d
>
> wplot,a,b
> woplot,a,d,color=2
>
> return
> end
>
> I am able to zoom in-out my plot any solution???
If it's the wplot/woplot that I wrote looooong ago, then I wouldn't
expect it to zoom whilst you have suspended the command line (via a read
or a wait or a get_kbrd).
Those wplot/woplot procedures weren't designed for that. They were
simply a poor-mans zoom-plot as I waited for the current function
graphics "plot" function to be implemented.
But, getting back to your code snippet, what you want to do is create
your own widget (using FG plot) but with a button that, when clicked,
outputs the command to a file or directly copies the file as you are
doing or whatever.
It's a bit of work but, if you are going to be doing this again and
again and again, worth the effort.
cheers,
paulv
p.s. OT, but if all you want is a y/n answer, I would do something like:
ans = GET_KBRD(1)
IF ( STRUPCASE(ans) EQ 'Y' ) THEN BEGIN
...blah blah
ENDIF
|
|
|