As pointed out in #2420 the documentation example for a Custom Viewer (the Shot Chart) does not work well with current versions of glue because the Shot Chart x and y limits are set to 0 - 1, which contains no data. For new users this looks like it's just not working. This fix does not require any changes to the example scripts; we add a custom add_data function that uses the Matplotlib bounding box to set some sensible initial limits if we haven't already set limits (which the example later does in a setup function).
Note that we can't use axes.relim() for this because hexbin returns a Collection which is not supported.
Pull Request Template
Description
As pointed out in #2420 the documentation example for a Custom Viewer (the Shot Chart) does not work well with current versions of glue because the Shot Chart x and y limits are set to 0 - 1, which contains no data. For new users this looks like it's just not working. This fix does not require any changes to the example scripts; we add a custom
add_data
function that uses the Matplotlib bounding box to set some sensible initial limits if we haven't already set limits (which the example later does in asetup
function).Note that we can't use
axes.relim()
for this because hexbin returns a Collection which is not supported.Closes #2420