Dear All,<br><br>I was wondering if there was a bug in vtkXYPlotActor that doesn&#39;t allow one to plot field data (2 components) by specifying that the x axis should get the values from component 0 and the y axis from component 1 of the field. My code is at the end of this email.<br>
It seems that vtkXYPlotActor doesn&#39;t do what it should when I tell it to use component 0 as x values and component 1 as y values. <br><br>Maybe I am doing something wrong?<br><br>Please advise!<br><br>Many thanks,<br>
Adrian<br><br><br>&nbsp; vtkImageData *myPlot = vtkImageData::New ();<br>&nbsp; myPlot-&gt;SetNumberOfScalarComponents (2);<br>&nbsp; myPlot-&gt;Initialize();<br>&nbsp; myPlot-&gt;SetSpacing(1.0, 0.0, 0.0);<br>&nbsp; myPlot-&gt;SetDimensions (v-&gt;GetNumberOfTuples (), 1, 1);<br>
&nbsp; myPlot-&gt;SetOrigin(1.0, 0.0, 0.0);<br>&nbsp; myPlot-&gt;GetPointData ()-&gt;SetScalars (g);<br><br>&nbsp; vtkXYPlotActor* profile = vtkXYPlotActor::New();<br>&nbsp; profile-&gt;AddInput(myPlot);<br>&nbsp; profile-&gt;SetPlotColor (1, 1, 0, 0);<br>
&nbsp; profile-&gt;SetPlotColor (0, 0, 0, 1);<br>&nbsp; profile-&gt;GetPositionCoordinate()-&gt;SetValue( 0.05, 0.05, 0);<br>&nbsp; profile-&gt;GetPosition2Coordinate()-&gt;SetValue( 0.95, 0.95, 0);<br>&nbsp; profile-&gt;SetNumberOfXLabels(10);<br>
&nbsp; profile-&gt;SetDataObjectXComponent (0, 0);<br>&nbsp; profile-&gt;SetDataObjectYComponent (0, 1);<br>&nbsp; profile-&gt;SetXValuesToValue ();<br>&nbsp; profile-&gt;SetPointComponent (0, 1);<br>&nbsp; profile-&gt;SetTitle( &quot;g(v)&quot; );<br>
&nbsp; profile-&gt;SetXTitle( &quot;v&quot;);<br>&nbsp; profile-&gt;SetYTitle( &quot;g(v)&quot;);<br>&nbsp; profile-&gt;GetProperty()-&gt;SetColor( 0, 0, 0);<br>&nbsp; profile-&gt;GetProperty()-&gt;SetLineWidth( 2);<br>&nbsp; profile-&gt;SetLabelFormat(&quot;%g&quot;);<br>
&nbsp; vtkTextProperty* tprop = profile-&gt;GetTitleTextProperty();<br>&nbsp; tprop-&gt;SetColor(0.02,0.06,0.62);<br>&nbsp; tprop-&gt;SetFontFamilyToArial();<br>&nbsp; tprop-&gt;SetFontSize (30);<br>&nbsp; profile-&gt;SetAxisTitleTextProperty(tprop);<br>
&nbsp; profile-&gt;SetAxisLabelTextProperty(tprop);<br>&nbsp; profile-&gt;SetTitleTextProperty(tprop);<br clear="all"><br>-- <br>---------------------------------------------------<br>Adrian Albert<br>School of Engineering and Science<br>
Jacobs University Bremen<br>Germany<br>Tel.: 00494212003258