I'm working with data consisting in 2M points of aceleration in time, what im doing is apllying FFT to de dataset and ploting it to see behaviours.
I did it with Matplotlib but i have the problem that i can not see or select any point to see to wich (x,y) value correspond, too that i trully need (in matlab plot you can do it with a plot tool). I tried Bokeh but the problem is that is too slow plotting and ive been having some issues showing the plots (sometimes it plot, sometimes dont).
So my question is is there is any way to select (x,y) value (by clicking) in Matplotlib or if there is any plot tool to do this in a fast way?
this is the ploting data
Related
I want to detect lines within Scatter Plots, using python.
Specifically, my data set is of the Cartesian coordinates of points. (This data was gathered using four ultrasound sensors on servos).
Here are some data sets ,
And here are the lines I'd like to detect.
the problem is to write a python program that returns the start and endpoints of high certainty lines, given a list of points on the scatter plot.
The difficulty is that piecewise linear regression can't be applied directly since data is vertically stacked.
Is there a well known solution to this problem? Or maybe an ingenuous application of piecewise linear regression could work?
I'd really appreciate some functioning python code!
I need to draw additional graphics on top of plotly go.Box traces, therefore I need to know X and Y coordinates for boxplot rectangle vertices. So far the only solution I came up with is basically recalculating everything (quartiles; X positions based on boxgap, boxgroupgap, etc.), then manually setting the y-axis range to know where everything will end up on the plot. This seems very cumbersome.
Is there a way in python to get the coordinates of go.Box boxplot elements, especially the grouped boxplots with categorical x-axis? As far as I understand these coordinates are calculated in JS frontend -- maybe there is some trick to get them back with Dash using callbacks?
Consider a Manhattan plot for a genome-wide association study. The density of dots at the bottom of the plot is very high -- individual points are no longer visible. I'd like to skip plotting the points that completely overlap with other points (even though their x,y is not identical) to reduce the plotting time and the size of the exported PDF. Any recipes for achieving this? Collision detection? Subsampling?
I'd like to use matplotlib, though this requirement is optional. Ideally, the output should be visually identical to the "full" plot.
Some background info on the plot type:
https://en.wikipedia.org/wiki/Manhattan_plot
Familar with Matplotlib and Basemap, but I haven't noticed that some one has tried to plot intersected figure to visualize multi-dimension data.
Here is an practical scene: Satellite data now can capture the information of atmosphere in 3-d dimension which contain the spatial distribution in several vertical level.
The example figure here contain several subplots:
(1) Vertical profile of dust extinction coefficient from calipso satellite data. (2) The average profile for each slice of (1)
(3) The background figure represent the ground-level wind field of East Asia.
(4) Some purple streamline(look carefully) which pass through each slice represent the air mass trajectory.
The figure here represent essential information in one frame.
The Matplotlib and Basemap can help me to generate each subplot. Is there any useful tools or python package can organize all these elements into one.
In a standard 3D python plot, each data point is, by default, represented as a sphere in 3D. For the data I'm plotting, the z-axis is very sensitive, while the x and y axes are very general, so is there a way to make each point on the scatter plot spread out over the x and y direction as it normally would with, for example, s=500, but not spread at all along the z-axis? Ideally this would look like a set of stacked discs, rather than overlapping spheres.
Any ideas? I'm relatively new to python and I don't know if there's a way to make custom data points like this with a scatter plot.
I actually was able to do this using the matplotlib.patches library, creating a patch for every data point, and then making it whatever shape I wanted with the help of mpl_toolkits.mplot3d.art3d.
You might look for something called "jittering". Take a look at
Matplotlib: avoiding overlapping datapoints in a "scatter/dot/beeswarm" plot
It works by adding random noise to your data.
Another way might be to reduce the variance of the data on your z-axis (e.g. applying a log-function) or adjusting the scale. You could do that with ax.set_zscale("log"). It is documented here http://matplotlib.org/mpl_toolkits/mplot3d/api.html#mpl_toolkits.mplot3d.axes3d.Axes3D.set_zscale