Implement scaleanchor
domain constraints on matching axes
#3539
Labels
Projects
scaleanchor
domain constraints on matching axes
#3539
follow-up issue from #3506 where
matches
andscaleanchor
constraints on the same axes are disallowed.Pasting some of @alexcjohnson 's comment on the topic here:
#3506 (comment)
yeah, that one has some problems... looks like after a zoom/pan it manages to satisfy all the constraints (the very shrunken subplots I think are correct), but initially or after an autorange it does not.
Here's a more extreme example. Kind of a pathological case, where each subplot has x&y matching, and the x of each subplot is supposed to scale with the y of the previous... this is the case I think compounds height/width differences, so it should be expected that either the first or last subplot gets its data very compressed if you stretch it to a very non-square size. Right now it appears to apply all the
scaleanchor
constraints, but all thematches
constraints except the last are lost.I haven't looked at your code in detail yet, but in order to satisfy this kind of chained constraints seems to me it may be necessary to generate
scaleanchor
constraints based on eachmatches
constraint (usinggs._w
andgs._h
) and use that to run through thescaleanchor
algorithm, and only after that apply thematches
constraints explicitly.From a private slack convo:
also re: matches and scaleanchor constraints with different target axes - the mock I set up has two separate constraints on each axis (except the ends of the chain). My comment “the only allowed values of scaleanchor would be ‘x’ or nothing.” was about a single constraint, ie the constraint defined within one axis’s attributes. If you’ve already said
yaxis.matches: 'x'
it wouldn’t make sense to sayyaxis.scaleanchor: 'x2'
because that would be setting up a completely different constraint. But it should still be OK to sayxaxis2.scaleanchor: 'y'
. After you’ve already providedmatches
it seemed to me the only purpose ofscaleanchor
is “do you also want to constrain the scale along with the matching constraint”The text was updated successfully, but these errors were encountered: