<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7655.8">
<TITLE>R: [vtkusers] Plot XY</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

<P><FONT SIZE=2>I don't have the latests CVS version of VTK but VTK 5.4.2 that I have download from www.vtk.org<BR>
and so the code that you suggest me it doesn't&nbsp; work because it don't found these files:<BR>
vtkChartXY, vtkPlot.h.h, vtkContextView.h, vtkContextScene.h<BR>
There is some way to simply have a XYPlot of two vectors with my VTK release?<BR>
<BR>
Thank you<BR>
Edoardo<BR>
<BR>
-----Messaggio originale-----<BR>
Da: daviddoria@gmail.com per conto di David Doria<BR>
Inviato: dom 28/03/2010 20.10<BR>
A: edoardo.belletti@alice.it<BR>
Cc: VTK_forum<BR>
Oggetto: Re: [vtkusers] Plot XY<BR>
<BR>
On Sun, Mar 28, 2010 at 2:03 PM, &lt;edoardo.belletti@alice.it&gt; wrote:<BR>
<BR>
&gt;&nbsp;&nbsp; Hello,<BR>
&gt;<BR>
&gt; I am new to VTK so please sorry if this problem is obvious.<BR>
&gt;<BR>
&gt; I am trying to use the XYPlotActor object to create a simply plot of one<BR>
&gt; variable against another.<BR>
&gt;<BR>
&gt; I have found a piece of code in a past discussion and I have tried to run<BR>
&gt; it but the problem is that it doesn't found the<BR>
&gt; vtkFloatScalars.h file<BR>
&gt; is there anything in particular that I should add in the CMakeLists.txt to<BR>
&gt; include this library?<BR>
&gt; the code is this:<BR>
&gt;<BR>
&gt; int main()<BR>
&gt; {<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int dataSize = 4;<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; float x[4] = { 0, 1.5, 6.2, 10.2 };<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; float y[4] = {8, 9.3, 10.9, 27};<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vtkRectilinearGrid *curve1 = vtkRectilinearGrid::New();<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; curve1-&gt;SetDimensions(dataSize,1,1);<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vtkFloatScalars *dataValues = vtkFloatScalars::New();<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vtkFloatScalars *xCoords = vtkFloatScalars::New();<BR>
&gt;<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int w;<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for(w=0; w&lt;dataSize; w++)<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dataValues-&gt;InsertScalar(w, y[w]);<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xCoords-&gt;InsertScalar(w, x[w]);<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>
&gt;<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; curve1-&gt;SetXCoordinates(xCoords);<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; curve1-&gt;GetPointData()-&gt;SetScalars(dataValues);<BR>
&gt;<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vtkXYPlotActor *theXYPlot = vtkXYPlotActor::New();<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; theXYPlot-&gt;SetXValuesToArcLength();<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; theXYPlot-&gt;AddInput(curve1);<BR>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return 0;<BR>
&gt; }<BR>
&gt;<BR>
&gt; Thank you very much for the interest<BR>
&gt; Edoardo<BR>
&gt;<BR>
&gt;<BR>
&gt; There is no file in the current CVS called vtkFloatScalars.h, so I'm<BR>
assuming that is very old code.<BR>
<BR>
Marcus Hanwell has been working hard on new charting functionality - there<BR>
is a simple example here:<BR>
<A HREF="http://www.vtk.org/Wiki/VTK_Examples_Chart_XY">http://www.vtk.org/Wiki/VTK_Examples_Chart_XY</A><BR>
<BR>
You must have the latests CVS version of VTK built to use this new feature.<BR>
&lt;<A HREF="http://www.vtk.org/Wiki/VTK_Examples_Chart_XY">http://www.vtk.org/Wiki/VTK_Examples_Chart_XY</A>&gt;<BR>
Thanks,<BR>
<BR>
David<BR>
<BR>
</FONT>
</P>

</BODY>
</HTML>