[vtkusers] Problem rendering vtkChartXY

Riku subs at collab.se
Mon Mar 7 09:59:25 EST 2011


Hello,

I am presently using the vtkChartXY class (and related) to plot simple
X/Y plots. As I want to hardcopy them, I use the commonly described
method and pass the render window to a window to image filter, and
then on to a PNG writer. This works great for (more complicated)
visualizations I do, but vtkChartXY gives me problems.

At a resolution (i.e. render window size) of 600x600, for example, the
resulting image is grainy and generally unsuitable for printing. The
solution I've used is to set the render window size to something like
2000x2000 instead.

The problem: On Windows, I have to use the SetMagnification() trick to
get the image size right (as my screen size is smaller than
2000x2000), but for some reason I cannot get it to work for the
rendered vtkChartXY plots. The resulting images are broken up, mixed,
skewed and generally weird. What can I do about this?

Moreover, If I set the render window size close to my screen's maximum
size, all text scales with the plot and thus becomes too small for the
plot. I cannot find any way to change this behaviour. Is there any
way? For other rendering situations I have not had this issue.

The problem can be recreated with the example here:
http://www.vtk.org/Wiki/VTK/Examples/Cxx/Plotting/LinePlot
(Add render window --> window to image filter --> png writer, and set
render window size to something large.)

Thanks for any help or suggestions,

Riku



More information about the vtkusers mailing list