comp.lang.idl-pvwave archive - RDF feed
type: channel
description: Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
items: Re: Help with PLOTS

Re: Help with PLOTS
type: item
description: 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"
creator: meron
date: 1996-02-16T08:00:00-00:00

Re: Help with PLOTS
type: item
description: 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
creator: Ken Knighton
date: 1996-02-17T08:00:00-00:00

Re: Help with PLOTS
type: item
description: 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
creator: rkj
date: 1996-02-19T08:00:00-00:00

Re: Help with PLOTS
type: item
description: 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
creator: Sergei Senin
date: 1996-02-19T08:00:00-00:00

Re: Help with PLOTS
type: item
description: 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
creator: Sergei Senin
date: 1996-02-19T08:00:00-00:00