The new feature added in #262 skips plotting AMR patches that are outside the specified xlimits and ylimits, unless plotaxes.skip_patches_outside_xylimits == False as provided in #263. By default this is set to True.
I recently discovered that this doesn't work well with a mapped grid where a mapc2p function is provided to map the computational xc, yc to the physical space xp, yp for plotting. The problem is that xlimits, ylimits are specified in physical coordinates (what you see in the plot) whereas the check on whether to skip a patch is done before mapc2p is applied, and hence the xc ,yc used in the test are in computational coordinates. A patch may easily appear to be outside the limits even though after the mapping it will be inside. This is also a problem in 1d if mapc2p is specified to map xc to xp.
This would be fairly easy to fix if mapc2p were also a ClawPlotAxes attribute, and it seems like it probably should be since the axes should presumably be in the same coordinate system regardless of what item is being plotted on it.
However, for some reason (my bad design, probably), mapc2p is an attribute of a ClawPlotItem, or if that is not set, the code also checks for mapc2p as an attribute of plotdata, but there is no plotaxes.mapc2p.
Cleaning this up will take some work and needs further discussion.
In the meantime, users should be aware that if using a mapc2p function, you should also set plotaxes.skip_patches_outside_xylimits to False.
Should this be the default, rather than True?
The new feature added in #262 skips plotting AMR patches that are outside the specified xlimits and ylimits, unless
plotaxes.skip_patches_outside_xylimits == Falseas provided in #263. By default this is set toTrue.I recently discovered that this doesn't work well with a mapped grid where a
mapc2pfunction is provided to map the computationalxc, ycto the physical spacexp, ypfor plotting. The problem is thatxlimits, ylimitsare specified in physical coordinates (what you see in the plot) whereas the check on whether to skip a patch is done beforemapc2pis applied, and hence thexc ,ycused in the test are in computational coordinates. A patch may easily appear to be outside the limits even though after the mapping it will be inside. This is also a problem in 1d ifmapc2pis specified to mapxctoxp.This would be fairly easy to fix if
mapc2pwere also aClawPlotAxesattribute, and it seems like it probably should be since the axes should presumably be in the same coordinate system regardless of what item is being plotted on it.However, for some reason (my bad design, probably),
mapc2pis an attribute of aClawPlotItem, or if that is not set, the code also checks formapc2pas an attribute ofplotdata, but there is noplotaxes.mapc2p.Cleaning this up will take some work and needs further discussion.
In the meantime, users should be aware that if using a
mapc2pfunction, you should also setplotaxes.skip_patches_outside_xylimitstoFalse.Should this be the default, rather than
True?