hyperspy icon indicating copy to clipboard operation
hyperspy copied to clipboard

Improve plot docstring

Open ericpre opened this issue 2 years ago • 2 comments

As noticed in #3140, there is room for improvement in setting/passing arguments to the plot functions:

  • review navigator_kwds default value, need to remove setting mutable argument as default in the method definition
  • out-of-date docstring, kwargs of ImagePlot
  • docstring of ImagePlot.plot

ericpre avatar May 08 '23 09:05 ericpre

Just a note that we probably shouldn't be directly passing arguments to super. (or at least that is my understanding from the bit of reading that I have been doing)

By passing named arguments to the super.plot functions it opens us up to some weird behavior like what @thomasaarholt saw previously in #2338.

CSSFrancis avatar May 08 '23 16:05 CSSFrancis

I didn't look into details but this is most likely related to use of mutable object as default argument: https://docs.quantifiedcode.com/python-anti-patterns/correctness/mutable_default_value_as_argument.html

ericpre avatar May 18 '23 06:05 ericpre