-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Factored out spectral analysis functions from mlab into a separate module #9757
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
weiter im Text Traitlets komplett rausgeschmissen weiter im Text Refactor out mlab's spectral functions
I'm concerned by the addition of a different class instead of relying on our Axes class. I don't see the advantage, and the inconvenience is that this not coherent at all with the current API. Had this been discussed elsewhere? |
It's nice--but it looks to me like this is heading towards being an independent toolkit package rather than something that should be included in the main matplotlib repository. The heart of it is a specialized set of calculations; the plotting is almost incidental. We want to move matplotlib towards being a general plotting library, and delegate analysis calculations and specialized plotting to other libraries. This could be very useful as one of those other libraries. |
Aren't lot of these calculations in We just had a conversation about these fncs on gitter. The consensus seemed to be to try and deprecate the |
I think in an ideal world Matplotlib would just call Should Matplotlib expect users who want to plot spectral data to have an installation of scipy?
|
I do agree that it probably would be better to utilize the |
It looks like none of @NelleV @efiring @jklymak (as well as myself) believe that Matplotlib should include such a feature, and @dstansby seems to be OK either way (depending on the scipy situation). So I'll close the PR. I also believe that this functionality belongs to a third-party module, which can be listed in the third-party packages page (https://matplotlib.org/thirdpartypackages/index.html). |
Thank you for your work on this @vollbier please do not be discouraged that this is not merged! I agree with @efiring @anntzer that this would be better suited as a stand alone package which depends on Matplotlib. The two technical benefits to this are being able have more liberal dependencies than Matplotlib (ex scipy, fftw, etc) and to operate on your own release schedule. It also lets you have a much more opinionated domain specific API. This may mean something like seaborn (/https://seaborn.pydata.org) / altair ( https://altair-viz.github.io/) which are tuned to particular data structures and statistical computations or something like windrose (https://github.com/python-windrose/windrose/) which aggressively customizes the The tight coupling between data / computation and the axis labels, ticks, and scales breaks some of the core abstraction of Matplotlib and poses some problems for composition (what happens if I want to show two of these plots with different windowing? That information is in the title so one of them will be labeled wrong). The pattern of having a data / computation based object that you then call I am open to it living at |
The aim of this PR can be basically summarized by xkcd 26 - make basic spectral analysis in Matplotlib more accessible to occasional users. The main points are:
axis
), instead of a function based interface was implemented. Utilizing setter and getter methods (@property
) allows basic consistency checking when setting the attributes.spectrum_scalings.py
)y-axes (see image below).
window_spectrums.py
).This is work in progress. The interface is not fully stable yet, the documentation needs more work, and tests don't exist yet. It still would be nice to get some feedback on the basic approach, especially in relation to #9151. Of course, any help is warmly welcomed.
Little Example
The following code (taken from
psd_shotnoise.py
)produces

PR Checklist
more than one target found for cross-reference
for inherited methods and attributes.