[vtkusers] How to enable vtkAxis::RIGHT in vtkChartXY (multiple Y-Axis)

Eric E. Monson emonson at cs.duke.edu
Fri Jan 20 12:26:47 EST 2012


Hey Marcus, 

Yeah, that's a tough call on the API and naming. It makes sense once it's explained, but the "corners" part made me think of a grid of plots rather than plots superimposed on the same chart, just using different pairs of axes.

I think just having an enum and explaining the concept of corners in the documentation would go a long way. Maybe your idea, though, of reusing the vtkAxis enums and forcing users to enter a pair would be preferable. (I don't know how you'd want the system to respond if people entered something like bottom & top as the pair, though…) In that case (it might confuse the API, but) you could instead have the method called SetPlotAxisPair()?

Thanks,
-Eric


On Jan 20, 2012, at 10:23 AM, Marcus D. Hanwell wrote:

> 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