Re: Clipping IDLgrPolyLine objects? [message #13838] |
Thu, 17 December 1998 00:00 |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Darran Edmundson (dEdmundson@Bigfoot.com) writes:
> I've created my own Plot2D object that contains axes and
> any number of line plots. The user sets the axes range
> via a keyword parameter. Plots are then added via an
> object method, e.g.
>
> p = Obj_New('Plot2D', xrange=[0.0,50.0], yrange=[-0.5,0.5])
> x=findgen(100)
> p->addplot,x,sin(x)
>
> The problem is that the polyline object is not clipped to
> the box defined by the Plot2D range. If x spans a larger
> range (as it does above), the line crosses the boundary.
> While I can deal with clipping at the x endpoints easily
> enough, I can't think of a simple way to clip pieces of
> the polyline that go over the top or bottom. Is there
> a simple method of clipping polylines?
The simplest method is to add the lines with the OPLOT
command after the plot axes have been created. I've
never known it to NOT clip. How does your AddPlot method
work?
Cheers,
David
Oh, wait a minute. Is this being done in OBJECT
graphics? Humm. Still can't imagine it happening
if the polyline object is scaled correctly. Need
more info, I guess. :-(
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Progamming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|