[vtkusers] Problem rendering vtkChartXY

Marcus D. Hanwell marcus.hanwell at kitware.com
Wed Mar 9 11:21:58 EST 2011


On Mon, Mar 7, 2011 at 9:59 AM, Riku <subs at collab.se> wrote:
> 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.)
>
I will try to take a look at this, and add a test to the charts. I
thought that this would work due to the code in ParaView accomplishing
this. The font scaling is something we discussed, but hadn't gotten
too. We need a way to determine what is a window resize (font size
stays constant), and a magnification where we could just scale the
font sizes by the specified amount in the vtkContext2D perhaps.

Marcus



More information about the vtkusers mailing list