python - Running median of y-values over a range of x -
Below is a scattering plot that I have made with two oval arrays.
Scatter plot example
d Want to add to this plot a moving average of y I have photoshop in an example:
Modified scatter plot
Specifically, let me know the two values F x axis with 1 need mid-point data in the unit compartment (this range will vary among the many plots, but I can do it manually adjusted). I appreciate any suggestions that can tell me in the right direction.
I will use for bin sorting for you. This way you can easily apply any function and set the category that you are interested in. As an example of the versatility of the method, the error bar given by standard deviation of each bin To add:
running_std = [y [idx == k] for the .std () category (total_bins)] plt.errorbar (cartons -Delta / 2, running_media, running_stadi, fmt = none)
Comments
Post a Comment