Hi! :-)<br>I'm having a problem and it's:<br><br>I'd like to plot parallel coordinates but I can't. The vtkParallelCoordinatesRepresentation can't get my data. It doesn't plot the rows.<br><br>I'm trying to be guided by the example of the wiki: <a href="http://www.vtk.org/Wiki/VTK/Examples/Python/Infovis/ParallelCoordinatesView">http://www.vtk.org/Wiki/VTK/Examples/Python/Infovis/ParallelCoordinatesView</a><br>
(The example works very well; my code doesn't)<br><br>My code is:<br><b>(...)<br><br><span style="font-family: courier new,monospace;">reader = vtkDelimitedTextReader()</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">reader.DetectNumericColumnsOn()</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">reader.SetFieldDelimiterCharacters(" ")</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">reader.SetHaveHeaders(True)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">reader.SetMaxRecords(100)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">reader.SetFileName(".\DataSets\News.gbdiv")</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">reader.Update()</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">#table = reader.GetOutput()</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">rep = vtk.vtkParallelCoordinatesRepresentation()</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"># I don't know why this don't work<br><br style="font-family: courier new,monospace;"></span><span style="font-family: courier new,monospace;">rep.SetInputConnection(reader.GetOutputPort())</span> <br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"><br>#I have tried many ways to put my data in, but nothing works. another is:</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">#rep.SetInput(table)</span></b><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;" clear="all"><b style="font-family: courier new,monospace;">rep.SetInputArrayToProcess(0,0,0,0,'all')<br>rep.SetInputArrayToProcess(1,0,0,0,'music')<br>rep.SetInputArrayToProcess(2,0,0,0,'entertainment')<br>
rep.SetInputArrayToProcess(3,0,0,0,'health')<br>rep.SetInputArrayToProcess(4,0,0,0,'business')<br>rep.SetInputArrayToProcess(5,0,0,0,'sport')<br>rep.SetInputArrayToProcess(6,0,0,0,'science')<br>
rep.SetInputArrayToProcess(7,0,0,0,'environment')<br>rep.SetInputArrayToProcess(8,0,0,0,'politics')</b><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">#Here is the same code in the example of the wiki</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">rep.SetUseCurves(0) </span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">rep.SetLineOpacity(0.5)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">view.SetRepresentation(rep)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">view.SetInspectMode(1) </span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">view.SetBrushModeToLasso()</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">view.SetBrushOperatorToReplace()</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">def ToggleInspectors(obj,event):</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> if (view.GetInspectMode() == 0):</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> view.SetInspectMode(1)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> else:</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> view.SetInspectMode(0)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">view.GetInteractor().AddObserver("UserEvent", ToggleInspectors)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">view.GetRenderWindow().SetSize(1000,600)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">view.ResetCamera()</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">view.Render()</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">view.GetInteractor().Start()</span><br><br><br>The data read by the reader is(each column,All, Music, Enter..., is a coordinate):<br>
<b style="font-family: courier new,monospace;">All Music Entertainment Health Business Sport Science Environment Politics<br>2.02657807 0.86289549 0.31007752 1.10266160 0.92307692 0.27089783 0.98556846 0.45808520 0.11614402<br>
1.67774086 0.23969319 2.17054264 0.83650190 0.19230769 0.00000000 0.70397747 0.04580852 0.27100271<br>1.16279070 0.14381592 0.10335917 0.41825095 0.73076923 0.34829721 0.35198874 0.22904260 0.61943477</b><br style="font-family: courier new,monospace;">
<b style="font-family: courier new,monospace;">(...)</b><br style="font-family: courier new,monospace;"><br><br>What should I do to plot my data? What am I forgetting to? The reader get my data and the GetOutput() return a table. I've tried get some values by index and i'v got the right ones. But I can't plot it. =\<br>
<br>Thank you, <br>:)<br><br>-- <br>Henry<br><br>Bacharelado em Ciências de Computação - 2007<br>ICMC - USP - São Carlos<br>