<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 5.50.4611.1300" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2>Hi all,</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>I am still having problems with the vtkXYPlotActor class. I 
hope somebody can help</FONT></DIV>
<DIV><FONT size=2>me with this.</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>I create the vtkXYPlotActor, then the user has the ability to 
add data to the actor</FONT></DIV>
<DIV><FONT size=2>interactively. This works very well apart from the 
coloring/labels etc of the lines.</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>Below is a snippet of my code.</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>Now when I create the first line of my graph the color, name 
etc are all correct.</FONT></DIV>
<DIV><FONT size=2>However, when I add a second set, the colour etc of the second 
line are the defaults.</FONT></DIV>
<DIV><FONT size=2>As I pointed out in my previous post this is because the 
vtkLegendBoxActor<FONT size=2>-&gt;NumberOfEntries</FONT></FONT></DIV>
<DIV><FONT size=2>does not seem to be updated.</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>This is really important to me now. Does anybody have an idea 
what is wrong.</FONT></DIV>
<DIV><FONT size=2>Is the order of adding + setting data important 
etc???</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>Thanks for any help</FONT></DIV>
<DIV><FONT size=2>Simon</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT 
size=2>--------------------------------------------------------------------------------------------------------------------</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp; // Add the data set to the graph 
actor.</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp; 
_pcGraphActor-&gt;AddInput(data_set);<BR>&nbsp;&nbsp;&nbsp; 
data_set-&gt;Delete();</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp; // Set the label for curve.</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp; int icurve = 
_pcGraphActor-&gt;GetInputList()-&gt;GetNumberOfItems();<BR>&nbsp;&nbsp;&nbsp; 
char label[80];</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp; if (node_or_element == 0) 
sprintf(label,"%s%i","Node ",entity_id);<BR>&nbsp;&nbsp;&nbsp; 
else<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sprintf(label,"%s%i","Element 
",entity_id);</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp; 
_pcGraphActor-&gt;SetPlotLabel(icurve-1,label);</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp; // Map the curve to a color, for this we 
use the color table.</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp; float* rgb = 
_pcColorTable-&gt;GetColor(static_cast&lt;float&gt;(icurve-1));<BR>&nbsp;&nbsp;&nbsp; 
_pcGraphActor-&gt;SetPlotColor(icurve-1,rgb[0],rgb[1],rgb[2]);</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp; // Create the markers for the data 
points.</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp; vtkSphereSource* marker = 
vtkSphereSource::New();</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp; 
_pcGraphActor-&gt;SetPlotSymbol(icurve-1,marker-&gt;GetOutput());<BR>&nbsp;&nbsp;&nbsp; 
marker-&gt;Delete();</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp; // Redraw the graph</FONT></DIV>
<DIV><FONT size=2>
<DIV><FONT 
size=2>--------------------------------------------------------------------------------------------------------------------</FONT></DIV></FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>================================<BR>S.D.Bulman.<BR>Senior 
Research Officer.<BR>University of Wales Swansea.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2><A 
href="mailto:S.D.Bulman@swansea.ac.uk">S.D.Bulman@swansea.ac.uk</A></FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2>(W) +44 (0)1792 513179<BR>(H)&nbsp; +44 (0)1792 
511144<BR>================================<BR></FONT></DIV></BODY></HTML>