You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Prevent shared-label algorithm from ignoring/overwriting distinct axis labels #384
ifgroupisnotNone: # fail silently to avoid fragile API changes
foraxinaxs[1:]:
group.join(axs[0], ax) # add to grouper
ifspan:
self._update_axis_label(pos, axs)
ax._get_span_axes(pos, panels=False) returns every axes adjacent to the left edge: 1, 2, 3, 4, 5, 8 to share the same y axis label. I patched it like this:
...
axs=ax._get_span_axes(pos, panels=False) # returns panel or main axesifany(getattr(ax, '_share'+x) foraxinaxs):
continue# nothing to align or axes have parents_ref_label_text=getattr(ax, x+'axis').label.get_text() # PATCHaxs=list(_axfor_axinaxsifgetattr(_ax, x+'axis').label.get_text() ==_ref_label_text) # PATCHseen.update(axs)
...
There might be another issue on top of this: super-label coordinates are computed incorrectly in ._get_align_coord. The computation is based on some intermediate alignment of axes which is changed afterwards. If I do this
Thanks for the report and PR #385 -- will take a closer look when I can. Agree this makes sense -- the shared label algorithm should only consider subplots with identical labels. The sharing algorithm is pretty klunky right now.
Activity
syrte commentedon Aug 29, 2022
Try set
p.subplots(..., sharey=False, ...)?pulkin commentedon Aug 29, 2022
Labels re-appear in multitudes (i.e. expected behavior).
pulkin commentedon Sep 3, 2022
The problem is this code:
proplot/proplot/figure.py
Lines 1185 to 1206 in 29bc955
ax._get_span_axes(pos, panels=False)returns every axes adjacent to the left edge:1, 2, 3, 4, 5, 8to share the same y axis label. I patched it like this:... axs = ax._get_span_axes(pos, panels=False) # returns panel or main axes if any(getattr(ax, '_share' + x) for ax in axs): continue # nothing to align or axes have parents _ref_label_text = getattr(ax, x + 'axis').label.get_text() # PATCH axs = list(_ax for _ax in axs if getattr(_ax, x + 'axis').label.get_text() == _ref_label_text) # PATCH seen.update(axs) ...And the desired effect is kinda achieved.
close proplot-dev#384 (sort of)
pulkin commentedon Sep 7, 2022
There might be another issue on top of this: super-label coordinates are computed incorrectly in
._get_align_coord. The computation is based on some intermediate alignment of axes which is changed afterwards. If I do thisbefore and after figure is printed I get different results.
lukelbd commentedon Mar 29, 2023
Thanks for the report and PR #385 -- will take a closer look when I can. Agree this makes sense -- the shared label algorithm should only consider subplots with identical labels. The sharing algorithm is pretty klunky right now.
[-]Missing label[/-][+]Prevent shared-label algorithm from ignoring/overwriting distinct axis labels[/+]