On Fri, Oct 25, 2013 at 2:57 PM, Pierre Haessig <pierre.haes...@crans.org>wrote:

>  Hello,
>
>
> Now that that PR #2522 is merged, I don't know how much futher commenting
> is useful, but I think there are two API details that I feel could be
> better :
>
> 1) API dissymetry
>
> The new pyplot/axes API is now:
>
>  * 1 function *spectgram* now uses a mode argument to tune this behavior :
>
> *mode*: [ 'default' | 'psd' | 'magnitude' | 'angle' | 'phase' ]
>              What sort of spectrum to use.  Default is 'psd'. which takes
>              the power spectral density.  'complex' returns the
> complex-valued
>              frequency spectrum.  'magnitude' returns the magnitude
> spectrum.
>             'angle' returns the phase spectrum without unwrapping.  'phase'
>              returns the phase spectrum with unwrapping.
>
> * 3 new functions *phase_spectrum, angle_spectrum, magnitude_spectrum*which 
> complement the exising psd/csd
>
> -> I think this contributes to overcrowding axes/pyplot API. I like much
> better what is done with specgram so I would propose to add just one new
> function, for example *spectrum*(...mode='magnitude/angle/phase'). Using
> the same *mode *keyword as for specgram would increase the coherence of
> the API
>

Although it may reduce the number of functions, I don't think it increases
the coherence of the API.  Quite the opposite, in fact.  Besides the
inconsistency with psd and csd, I think having the plot types separate
makes sense because they really are not the same plots, they plot different
things in different ways and different units and using parameters.
Specgram, on the other hand, plots things in the same way with similar
units and mostly the same paramaters.  So I think specgram plots group
together much more cleanly than the other spectrum-related plots.
------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to