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
When plotting a cube with a number of dimensions higher than 2, the result of .plot() is an animation on the additional axes and is handled by mpl_animators. ArrayAnimatorWCS can take a dictionary coord_params that can be used to apply parameters to axeslabels, ticklabels, etc. However, when I pass this dict through .plot, I get the exception shown below. This seems to be because ndcube is supplying its own coord_params, but is not accounting for a user-specified coord_params:
If a user specifies coord_params, both are passed to mpl-animators, leading to the exception below.
If this is not a bug, but rather a feature request, feel free to relabel. I did assume this would work though because the .plot docstring says,
Additional keyword arguments are given to the underlying plotting infrastructure which depends on the dimensionality of the data and whether 1 or 2 plot_axes are defined
Hi @wtbarnes. Thanks for raising this issue. I would class it as a bug. After a quick glance I think this should be fixed simply by extracting user input coord_params and updating the auto-generated ones before line 195 of mpl_plotter.py, e.g.
Yes, I think if possible this should be a figure test. I'm not that expert on figure tests when the output is an animation. Perhaps you can compare with any other such tests in ndcube or ask @Cadair.
Describe the bug
When plotting a cube with a number of dimensions higher than 2, the result of
.plot()
is an animation on the additional axes and is handled bympl_animators
.ArrayAnimatorWCS
can take a dictionarycoord_params
that can be used to apply parameters to axeslabels, ticklabels, etc. However, when I pass this dict through.plot
, I get the exception shown below. This seems to be becausendcube
is supplying its owncoord_params
, but is not accounting for a user-specifiedcoord_params
:ndcube/ndcube/visualization/mpl_plotter.py
Lines 193 to 194 in 481510b
If a user specifies
coord_params
, both are passed tompl-animators
, leading to the exception below.If this is not a bug, but rather a feature request, feel free to relabel. I did assume this would work though because the
.plot
docstring says,https://docs.sunpy.org/projects/ndcube/en/stable/api/ndcube.visualization.mpl_plotter.MatplotlibPlotter.html#ndcube.visualization.mpl_plotter.MatplotlibPlotter.plot
To Reproduce
throws the following exception
Screenshots
No response
System Details
Installation method
pip
The text was updated successfully, but these errors were encountered: