[vtkusers] Problem with logarithmic scale in vtkChartXY
Mario Rodriguez
biomates at telefonica.net
Sat Feb 13 14:53:26 EST 2016
Hi,
Suppose I want to plot a polygonal line connecting points (0, e^0), (10,
e^10), and (20, e^20) onto the canvas provided by class vtkChartXY with
logarithmic scale in the y-axis. The output should be a straight line.
But points are plotted ignoring the logarithmic scale. Only when I click
on the image, or resize the window, the three points are allocated in
their correct positions.
My environment is TCL + VTK 6.3
I'm not sure if I am doing something wrong, or if I found a bug. Here is
a reduced version of my problem:
#########################
package require vtk
package require vtkinteraction
vtkFloatArray arrayX1
arrayX1 SetName "arrayX1"
arrayX1 InsertNextValue 0.0
arrayX1 InsertNextValue 10.0
arrayX1 InsertNextValue 20.0
vtkFloatArray arrayY1
arrayY1 SetName ""
arrayY1 InsertNextValue 1.0
arrayY1 InsertNextValue 22026.46579480671
arrayY1 InsertNextValue 4.851651954097903E8
vtkTable table1
table1 AddColumn arrayX1
table1 AddColumn arrayY1
vtkChartXY chart1
[chart1 GetAxis 0] SetLogScale 1
set line [chart1 AddPlot 0]
$line SetInputData table1 0 1
vtkContextScene scenechart1
scenechart1 AddItem chart1
vtkContextActor actorchart1
actorchart1 SetScene scenechart1
vtkRenderer renderer1
renderer1 SetBackground 1 1 1
renderer1 AddActor actorchart1
vtkRenderWindow renWin
renWin AddRenderer renderer1
vtkRenderWindowInteractor iren
iren SetRenderWindow renWin
iren Initialize
iren Start
#########################
I would greatly appreciate any help on this issue.
--
Mario
More information about the vtkusers
mailing list