[vtkusers] How to enable vtkAxis::RIGHT in vtkChartXY (multiple Y-Axis)
Marcus D. Hanwell
marcus.hanwell at kitware.com
Fri Jan 20 10:23:11 EST 2012
Hi,
Sorry about the delay in replying - I was out of the country.
On Thu, Jan 19, 2012 at 9:37 AM, Eric E. Monson <emonson at cs.duke.edu> wrote:
> Hey Gerrit,
>
> You can actually leave AutoAxes on. The way to get the extra axes to show up
> and use them for plots is to set the "plot corner". This nomenclature is a
> bit opaque to me, but the idea is that each chart has four possible corners.
> The default one is 0, which uses the left and bottom axes. Corner 1 uses
> bottom and right; 2 uses right and top and 3 uses top and left.
Is there a better name/API you would suggest here? I had been meaning
to add an enum for this, and can get that in. I was also considering
API to set the plot corner taking a pair of axis positions (such as
vtkAxis::LEFT, vtkAxis::TOP) and reusing the existing enums.
>
> So, after you've added a plot to the chart, you can call
>
> chart->SetPlotCorner( chart->GetPlot(0), 1);
>
> and this will switch it to using the bottom and right axes. I would think
> there would be an enum for the corner integers, but I couldn't fine one
> offhand. I haven't played around enough to see how this behaves with
> multiple plots that have different ranges, etc – only tried it out to see
> that the basic functionality works.
The basic model is that a plot has two axes (a vertical and a
horizontal axis) associated with it, and when calculating axis ranges
all plots associated with that axis are taken into account when
calculating the range. When panning and zooming all active axes are
panned and zoomed, and this functionality is exposed in ParaView. The
naming was also influenced by ParaView, and would have benefited from
a little code review.
Hopefully this makes things clearer to you both. Please let me know if
you spot issues with this functionality.
Marcus
More information about the vtkusers
mailing list