[vtkusers] How to setup Parallel Coordinates?

Henry henryusp at gmail.com
Fri Oct 15 23:49:00 EDT 2010


Hi! :-)
I'm having a problem and it's:

I'd like to plot parallel coordinates but I can't. The
vtkParallelCoordinatesRepresentation can't get my data. It doesn't plot the
rows.

I'm trying to be guided by the example of the wiki:
http://www.vtk.org/Wiki/VTK/Examples/Python/Infovis/ParallelCoordinatesView
(The example works very well; my code doesn't)

My code is:
*(...)

reader = vtkDelimitedTextReader()
reader.DetectNumericColumnsOn()
reader.SetFieldDelimiterCharacters(" ")
reader.SetHaveHeaders(True)
reader.SetMaxRecords(100)
reader.SetFileName(".\DataSets\News.gbdiv")
reader.Update()
#table = reader.GetOutput()

rep = vtk.vtkParallelCoordinatesRepresentation()

# I don't know why this don't work

rep.SetInputConnection(reader.GetOutputPort())

#I have tried many ways to put my data in, but nothing works. another is:
#rep.SetInput(table)*

*rep.SetInputArrayToProcess(0,0,0,0,'all')
rep.SetInputArrayToProcess(1,0,0,0,'music')
rep.SetInputArrayToProcess(2,0,0,0,'entertainment')
rep.SetInputArrayToProcess(3,0,0,0,'health')
rep.SetInputArrayToProcess(4,0,0,0,'business')
rep.SetInputArrayToProcess(5,0,0,0,'sport')
rep.SetInputArrayToProcess(6,0,0,0,'science')
rep.SetInputArrayToProcess(7,0,0,0,'environment')
rep.SetInputArrayToProcess(8,0,0,0,'politics')*

#Here is the same code in the example of the wiki
rep.SetUseCurves(0)
rep.SetLineOpacity(0.5)
view.SetRepresentation(rep)
view.SetInspectMode(1)
view.SetBrushModeToLasso()
view.SetBrushOperatorToReplace()
def ToggleInspectors(obj,event):
    if (view.GetInspectMode() == 0):
        view.SetInspectMode(1)
    else:
        view.SetInspectMode(0)
view.GetInteractor().AddObserver("UserEvent", ToggleInspectors)
view.GetRenderWindow().SetSize(1000,600)
view.ResetCamera()
view.Render()
view.GetInteractor().Start()


The data read by the reader is(each column,All, Music, Enter..., is a
coordinate):
*All Music Entertainment Health Business Sport Science Environment Politics
2.02657807 0.86289549 0.31007752 1.10266160 0.92307692 0.27089783 0.98556846
0.45808520 0.11614402
1.67774086 0.23969319 2.17054264 0.83650190 0.19230769 0.00000000 0.70397747
0.04580852 0.27100271
1.16279070 0.14381592 0.10335917 0.41825095 0.73076923 0.34829721 0.35198874
0.22904260 0.61943477*
*(...)*


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. =\

Thank you,
:)

-- 
Henry

Bacharelado em Ciências de Computação - 2007
ICMC - USP - São Carlos
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20101016/34768b33/attachment.htm>


More information about the vtkusers mailing list