[vtkusers] vtkXYPlotActor, SetDataObjectXComponent not working with tcl?
pablo p del castillo
pablodecastillo at yahoo.es
Tue Mar 27 13:13:55 EDT 2012
Its working perfectly, just adding SetXValuesToValue before than SetDataObjectXComponent.
Thanks
________________________________
De: pablo p del castillo <pablodecastillo at yahoo.es>
Para: VTK Mailing List <vtkusers at vtk.org>
Enviado: Martes 27 de marzo de 2012 15:34
Asunto: vtkXYPlotActor, SetDataObjectXComponent not working with tcl?
Hi,
Playing with vtkXYPlotActor in TCL i did this sample, but i can not choose OX with SetDataObjectXComponent, any idea?;
package require vtk
package require vtkinteraction
vtkMath math
vtkXYPlotActor xyplot
xyplot SetTitle "Pressure "
xyplot SetXTitle "test"
xyplot SetYTitle "P"
xyplot SetPlotColor 0 1 0 0
xyplot SetPlotColor 1 0 1 0
xyplot SetLabelFormat "%-#6.2f"
vtkDoubleArray array_s
vtkDoubleArray array_x
vtkFieldData field
vtkDataObject data
for { set i 1 } { $i <= 10 } { incr i } {
set val [math Random 0 1]
puts $val
array_s InsertValue $i $val
set dumy [ expr $i + 10.0 ]
puts $dumy
array_x InsertValue $i $dumy
}
field AddArray array_x
field AddArray array_s
data SetFieldData field
xyplot AddDataObjectInput data
xyplot SetDataObjectXComponent 0 0
xyplot SetDataObjectYComponent 0 1
xyplot PlotPointsOn
[xyplot GetProperty] SetPointSize 3
vtkRenderer ren1
vtkRenderWindow renWin
renWin AddRenderer ren1
vtkRenderWindowInteractor iren
iren SetRenderWindow renWin
ren1 AddActor2D xyplot
renWin SetSize 600 600
ren1 ResetCamera
# Get handles to some useful objects
#
iren AddObserver UserEvent {wm deiconify .vtkInteract}
renWin Render
Advanced thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120327/46eda438/attachment.htm>
More information about the vtkusers
mailing list