Assigning to a cell that is already occupied leaves the previous tile's axes on the figure. Tiled.__setitem__ unconditionally calls self.fig.add_subplot(self.gs[inds]), so the replaced axes is never removed and stays visible, drawn underneath the new one.
Reproduction
import plopp as pp
from plopp.data.testing import data_array
da = data_array(ndim=1)
t = pp.tiled(1, 1)
t[0, 0] = da.plot()
t[0, 0] = (da * 5.0).plot()
len(t.fig.get_axes()) # 2
[a.get_visible() for a in t.fig.get_axes()] # [True, True]
[a.get_ylim() for a in t.fig.get_axes()] # [(-1.1, 1.1), (-5.48, 5.5)]
Both axes render on top of each other. Since their ranges differ, the result carries two interleaved sets of tick labels and a doubled axis label:

Composition replays the superseded tile
_history keeps every assignment, and __add__/__truediv__ replay all of them into the new figure, so the discarded tile is carried into the combined figure as well:
combined = t + da.plot()
combined.nrows, combined.ncols # 1, 2
len(combined.fig.get_axes()) # 3, where one axes per cell would be 2
Expected
Replacing a tile should leave a single axes in that cell, and composition should replay only the tiles the figure currently holds.
Notes
Fixing this means deciding what replacement should mean. Removing the stale axes and dropping the superseded _history entry is the obvious reading, but it interacts with axis sharing: Matplotlib provides no way to un-share axes, so a replaced tile cannot be detached from the tiles it was joined to. The shared-axes work in the tiled figures PR therefore rejects replacement outright when sharing is enabled, which sidesteps rather than solves the underlying issue.
Found while working on axis sharing for tiled figures; present on main and unrelated to that branch.
Assigning to a cell that is already occupied leaves the previous tile's axes on the figure.
Tiled.__setitem__unconditionally callsself.fig.add_subplot(self.gs[inds]), so the replaced axes is never removed and stays visible, drawn underneath the new one.Reproduction
Both axes render on top of each other. Since their ranges differ, the result carries two interleaved sets of tick labels and a doubled axis label:
Composition replays the superseded tile
_historykeeps every assignment, and__add__/__truediv__replay all of them into the new figure, so the discarded tile is carried into the combined figure as well:Expected
Replacing a tile should leave a single axes in that cell, and composition should replay only the tiles the figure currently holds.
Notes
Fixing this means deciding what replacement should mean. Removing the stale axes and dropping the superseded
_historyentry is the obvious reading, but it interacts with axis sharing: Matplotlib provides no way to un-share axes, so a replaced tile cannot be detached from the tiles it was joined to. The shared-axes work in the tiled figures PR therefore rejects replacement outright when sharing is enabled, which sidesteps rather than solves the underlying issue.Found while working on axis sharing for tiled figures; present on
mainand unrelated to that branch.