The plot_polarisation_vectors function is quite useful for plotting data, but users are limited by the fact that it is a single function and has limited parameters right now. **kwargs can help with this, but it would just make each called function more confusing. It is not well designed and not extensible!
After #70 and some other examples, this has become even more apparent. Users want to be able to manipulate the plots. Some of the issue lies with matplotlib's plotting system, but most of the problems are due to the plot_polarisation_vectors design.
Solution
I will likely try to refactor plot_polarisation_vectors into a class that is more flexible and extensible, and not limited to parameters.
For example, it can simply have a norm attribute so that the user can set any matplotlib.colors.colors.Normalize class, which will then be used for any plotting. This is much more user friendly, as one can then play with the underlying functionality freely, rather than relying on someone having the time to add parameters to a function.
Most of the underlying functionality can be done this way, with clearly stated defaults.
It also makes things easily to test, as each attribute can be individually called and checked.
To do:
[ ] Deprecation warnings for plot_polarisation_vectors.
[ ] A new class, perhaps named PolarisationPlotter, which includes setters for setting the underlying functionality of the plotting parameters. See the norm example above.
[ ] Docstrings for each method
[ ] Tests for all methods
[ ] Docs examples showing extensive usecases
[ ] New description in README.
Acceptance Criteria
[ ] Python class that replaces and improves all functionality of plot_polarisation_vectors.
Overview
The
plot_polarisation_vectors
function is quite useful for plotting data, but users are limited by the fact that it is a single function and has limited parameters right now.**kwargs
can help with this, but it would just make each called function more confusing. It is not well designed and not extensible!After #70 and some other examples, this has become even more apparent. Users want to be able to manipulate the plots. Some of the issue lies with matplotlib's plotting system, but most of the problems are due to the
plot_polarisation_vectors
design.Solution
I will likely try to refactor
plot_polarisation_vectors
into a class that is more flexible and extensible, and not limited to parameters.norm
attribute so that the user can set anymatplotlib.colors.colors.Normalize
class, which will then be used for any plotting. This is much more user friendly, as one can then play with the underlying functionality freely, rather than relying on someone having the time to add parameters to a function.To do:
plot_polarisation_vectors
.PolarisationPlotter
, which includes setters for setting the underlying functionality of the plotting parameters. See thenorm
example above.Acceptance Criteria
plot_polarisation_vectors
.