comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Help with PLOTS
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Help with PLOTS [message #5836] Mon, 19 February 1996 00:00
rkj is currently offline  rkj
Messages: 66
Registered: February 1996
Member
Ken Knighton (knighton@gav.gat.com) wrote:
: rkj@dukebar.crml.uab.edu (R. Kyle Justice) wrote:
: >Can anyone help with the following problem using
: >PV-Wave's PLOTS function:
: >
: >I have two arrays(xarr, yarr), one containing x and the other
: >containing y coordinates that I want to plot on top of
: >an image.
: >
: >The following command does not give me what I want and I
: >can't figure out why:
: >
: >PLOTS, [xarr,xarr], [yarr,yarr], /Device
: >


: In IDL or PV-Wave, you could use the PSYM keyword:

: PLOTS, xarr, yarr, /DEVICE, PSYM=3 ;or other symbols. see manual



: I hope this helps.

: Ken Knighton knighton@gav.gat.com knighton@cts.com
: General Atomics
: San Diego CA


Thanks Ken and Mati!

Using PSym=3 was all that I needed. And to think I wasted several
hours before posting . . . :)

When I did not use PSym, the last and first points in the arrays
were connected as was suggested. This was a problem since I
wanted to fill in part of insersecting polylines. I have
an outer contour and an inner contour and I want to fill only
the "doughnut" and not the "hole." Who knows, there is
probably a way to do this POLYFILL but I could not figure it
out. I did use POLYFILLV to get the points inside the
two overlapping boundaries.

Kyle

"In abundance of counselors there is victory." - Proverb
Re: Help with PLOTS [message #5838 is a reply to message #5836] Mon, 19 February 1996 00:00 Go to previous message
Sergei Senin is currently offline  Sergei Senin
Messages: 23
Registered: February 1996
Junior Member
rkj@dukebar.crml.uab.edu (R. Kyle Justice) wrote:
> Can anyone help with the following problem using
> PV-Wave's PLOTS function:
>
> I have two arrays(xarr, yarr), one containing x and the other
> containing y coordinates that I want to plot on top of
> an image.
>
> The following command does not give me what I want and I
> can't figure out why:
>
> PLOTS, [xarr,xarr], [yarr,yarr], /Device
> If I use a loop I get the desired results, but it is
> quite slow at plotting the points:
>
> FOR i=0,N_ELEMENTS(xarr)-1 DO PLOTS, $
> [xarr(i),xarr(i)], [yarr(i),yarr(i)], /Device
>
> (xarr and yarr have the same number of elements)
>
> I know there has to be a way to plot the points
> using array notation without looping . . .
> Kyle J.
>
>

I just tried it:
;;image from pv-wave examples
openr, 1, filepath('head.img', subdir='data')
head_ls=bytarr(512, 512)
readu, 1, head_ls
close, 1
tv, head_ls
a=findgen(100)
c=a^3
b=a^2
plots, a, c
plots, a, b

It gave me two curves (c and b) plotted over this image

When I used "device" keyword, it...well... didn't work. (I think the
explanation is in the Reference book)

Making plots as

plots, [a, a] , [b, b]

gives two curves: a=a and b=a^2



--
S.S.
ss@ee.port.ac.uk
http://www.ee.port.ac.uk:80/~ss-www/ruspage.html
Re: Help with PLOTS [message #5839 is a reply to message #5836] Mon, 19 February 1996 00:00 Go to previous message
Sergei Senin is currently offline  Sergei Senin
Messages: 23
Registered: February 1996
Junior Member
Sergei Senin <ss@ee.port.ac.uk> wrote:
> skipped<<<
> plots, [a, a] , [b, b]
>
> gives two curves: a=a and b=a^2
^^^^
Oops , sorry. Was too eager to help :-)

plots, [a, a] , [b, b] -
It looks like it connects the first and the last points on the graph.

--
S.S.
ss@ee.port.ac.uk
http://www.ee.port.ac.uk:80/~ss-www/ruspage.html
Re: Help with PLOTS [message #5846 is a reply to message #5836] Sat, 17 February 1996 00:00 Go to previous message
Ken Knighton is currently offline  Ken Knighton
Messages: 44
Registered: May 1995
Member
rkj@dukebar.crml.uab.edu (R. Kyle Justice) wrote:
> Can anyone help with the following problem using
> PV-Wave's PLOTS function:
>
> I have two arrays(xarr, yarr), one containing x and the other
> containing y coordinates that I want to plot on top of
> an image.
>
> The following command does not give me what I want and I
> can't figure out why:
>
> PLOTS, [xarr,xarr], [yarr,yarr], /Device
>


In IDL or PV-Wave, you could use the PSYM keyword:

PLOTS, xarr, yarr, /DEVICE, PSYM=3 ;or other symbols. see manual



I hope this helps.

Ken Knighton knighton@gav.gat.com knighton@cts.com
General Atomics
San Diego CA
Re: Help with PLOTS [message #5849 is a reply to message #5846] Fri, 16 February 1996 00:00 Go to previous message
meron is currently offline  meron
Messages: 51
Registered: July 1995
Member
In article <4g2r6b$i1k@maze.dpo.uab.edu>, rkj@dukebar.crml.uab.edu (R. Kyle Justice) writes:
> Can anyone help with the following problem using
> PV-Wave's PLOTS function:
>
> I have two arrays(xarr, yarr), one containing x and the other
> containing y coordinates that I want to plot on top of
> an image.
>
> The following command does not give me what I want and I
> can't figure out why:
>
> PLOTS, [xarr,xarr], [yarr,yarr], /Device
>
>
> If I use a loop I get the desired results, but it is
> quite slow at plotting the points:
>
> FOR i=0,N_ELEMENTS(xarr)-1 DO PLOTS, $
> [xarr(i),xarr(i)], [yarr(i),yarr(i)], /Device
>
> (xarr and yarr have the same number of elements)
>
> I know there has to be a way to plot the points
> using array notation without looping . . .
>
>
Just do

PLOTS, XARR, YARR [optional keywords here]

By doubling the array (the way you did it) you loop back from your
last point to the first one, introducing an extra straight line. Is
this what happened?

Mati Meron | "When you argue with a fool,
meron@cars3.uchicago.edu | chances are he is doing just the same"
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Help with FSLIDER
Next Topic: Using callable IDL from C / how to avoid IDL start up screen ?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 13:42:32 PDT 2025

Total time taken to generate the page: 0.00677 seconds