<DIV>Hi,</DIV>
<DIV>I think there is a bug in <FONT size=2>vtkXYPlotActor.</FONT></DIV>
<DIV>The following curve is clipped on the Y axis if offset < 0.1 :</DIV>
<DIV> </DIV>
<DIV>#include <vtkRenderWindow.h><BR>#include <vtkRenderWindowInteractor.h><BR>#include <vtkRenderer.h><BR>#include <vtkXYPlotActor.h><BR>#include <vtkFloatArray.h><BR>#include <vtkFieldData.h><BR>#include <vtkDataObject.h></DIV>
<DIV>#ifdef _MSC_VER<BR>#pragma comment( lib, "vtkCommon.lib" )<BR>#pragma comment( lib, "vtkRendering.lib" )<BR>#pragma comment( lib, "vtkHybrid.lib" )<BR>#endif</DIV>
<DIV>int main()<BR>{<BR> // rendering stuff<BR> vtkRenderWindow * renWin = vtkRenderWindow::New();<BR> vtkRenderWindowInteractor * Iter = vtkRenderWindowInteractor::New();<BR> renWin->SetInteractor( Iter );<BR> vtkRenderer * ren = vtkRenderer::New(); <BR> renWin->AddRenderer( ren );</DIV>
<DIV> // plot actor<BR> vtkXYPlotActor * xyplot = vtkXYPlotActor::New(); <BR> xyplot->SetWidth( 1 );<BR> xyplot->SetHeight( 1 );<BR> xyplot->SetPosition( 0, 0 );<BR> ren->AddActor2D( xyplot );</DIV>
<DIV> // add buggy curve ([0, 0.09], [1, 1.59])<BR> vtkFloatArray * xarray = vtkFloatArray::New();<BR> vtkFloatArray * yarray = vtkFloatArray::New();</DIV>
<DIV> </DIV>
<DIV> double offset = 0.09;<BR> xarray->InsertNextValue( 0 );<BR> yarray->InsertNextValue( offset );<BR> xarray->InsertNextValue( 1 );<BR> yarray->InsertNextValue( 1.50 + offset );</DIV>
<DIV> </DIV>
<DIV> vtkFieldData * values = vtkFieldData::New();<BR> values->AllocateArrays( 2 );<BR> values->AddArray( xarray );<BR> values->AddArray( yarray );<BR> <BR> vtkDataObject * data = vtkDataObject::New();<BR> data->SetFieldData( values );</DIV>
<DIV> xyplot->AddDataObjectInput( data );<BR> xyplot->SetDataObjectYComponent( 0, 1 );</DIV>
<DIV> // render<BR> renWin->SetSize( 500, 500 );<BR> renWin->Render();<BR> Iter->Initialize();<BR> Iter->Start();<BR>}</DIV>
<DIV> </DIV>
<DIV>If offset >= 0.1 there is no problem.</DIV>
<DIV>I use vtk 4.4. with vtkXYPlotActor.cxx revision 1.52.</DIV><BR><BR>Aurélien REGAT-BARREL<p>
                <hr size=1>
Yahoo! Mail : votre e-mail personnel et gratuit qui vous suit partout !
<br><a href="http://fr.rd.yahoo.com/mail/taglines/*http://fr.rd.yahoo.com/mail/mail_taglines/default/*http://fr.benefits.yahoo.com/">Créez votre Yahoo! Mail</a>
<br><br>
Dialoguez en direct avec vos amis grâce à <a href="http://fr.rd.yahoo.com/mail/taglines/*http://fr.rd.yahoo.com/messenger/mail_taglines/default/*http://fr.messenger.yahoo.com/">Yahoo! Messenger !</a>