How can I visualize data using RPM-Order Plots with python - python

One of my projects needs order analysis of vibration signals with Python instead of Matlab, they want to visualize data using colormap which usually has frequency on the horizontal axis and rotational speed on the vertical axis. Just like this picture:
How can I do this?

Related

Customizing matlab plots for high resolution and custom scaling

I have a 1d signal of many samples (millions). I also have it's wavelet transform coefficients (in float64) and frequencies stored in arrays. I am trying to make a high resolution plot of both the signal level vs time and also of the scallogram. The default parameters for size etc are too small for effective visualization. I am exporting it to both png and pdf using savefig object.
I would like to make it higher resolution (1920*1080 or equivalent sizes depending upon aspect ratio). I am unable to comprehend matplotlib arguments and objects and unfortunately I have not been able to follow well with tutorials available online. There is so much functionality and different ways of doing it, that moving from one resource to another for learning required re learning something new for the same task.
So far I have been able to understand interpolation choices, colormap choices, figure label, x and y labels. I am unable to understand the difference between imshow and plot, how to pass on size and fidelity of the plot etc, or passing the axis scales (currently my scales are off). The figsize is mentioned in inches and I am not sure how it relates to pixels. Would love to hear guidance on the same.
I would also like to plot STFT for my samples with high image fidelity with custom window size etc. Currently using specgram but would like to know how to pass on window size, overlap etc and the color map and interpolation schemes, and if other alternatives are available.
I'm plotting these for multiple different data sets in a single code (for loop) and would like to have all images being of uniform size and same scale since all have equal sample sizes.

Heatmap generation in Python using different heat intensity

I am trying to generate a Hit map of a scatter plot using matplotlib's hist2d. Can I change the heat level intensity for that? I looks like heat color gets changes linearly. I want to do it exponentially? Is there any other tool in python other than matplotlib's hist2d that I can use.
I think you probably want to use color normalization

3D plot of 2D pandas data frame - z-axis limits, interactivity

I Posted this question about 3D plots of data frames:
3D plot of 2d Pandas data frame
and the user referred me very very helfully to this:
Plotting Pandas Crosstab Dataframe into 3D bar chart
It use useful and the code worked in principle, but it lookes like a mess (see image below) for several reasons:
I have huge number of values to plot (470 or so, along the y-axis) so perhaps a bar chart is not the best way (I am going for a histogram kind of look, so I assumed very narrow bars would be suitable)
my counts (z axis) do not give almost any information, because the differences I need to see are from 100 to the max value
how can I make the 3D plot that shows up interactive? (being able to rotate etc) - I have seen it done in blogs/videos but sure if it's something on Tools -> Preferences that I can't find
So re: the second issue, simple enough, I tried to just change the limits of the zbar as I would for a 2D Plot, by incorporating:
ax.set_zlim([110,150])
just before the axis labels, but obviously this is the wrong way:
SO do I have to limit the values from the original data set (i.e. filter out <110), or is there a way to do this from the plot?

Scatter 3D for Large Data-Set in Plotly

I have a 3D scatter which wanna plot using Plotly in python. The problem is size of the dataframe is too large and I want to use webgl to plot the graph. As I know plotly has go.Scatter3d function to plot scatters. Also, there is a go.Scattergl to plot large datasets. However, U can't find something like go.Scatter3Dgl. What should I do?
I believe 3D scatter plots use webgl by default. If you inspect a scatter_3d you'll find that it is in a class="gl-container". Likewise a regular Scatter is in a class="main-svg and a Scattergl is in a class="gl-container".
From plotly:
Note: It is important to note that any figures containing WebGL traces
(i.e. of type scattergl, heatmapgl, contourgl, scatter3d, surface,
mesh3d, scatterpolargl, cone, streamtube, splom, or parcoords) that
are exported in a vector format will include encapsulated rasters,
instead of vectors, for some parts of the image.

2D color and quiver plot in python with large datasets

In the very near future I will be doing some analysis of measurement data. This data is geographical data (e.g. height measurements and wind measurements) which has a high resolution (some 50 million x, y, and z points for example). Plotting such a dataset is very slow in matplotlib and I wonder if there are better options.
The plots I see myself creating in the near future would be a quiver plot (for the winddirections) and color plots for terrain heights. It must be noted that the x, y and z values do not line up to be a square or rectangular grid.
Besides creating figures it is likely that the dataset will also need to be shown on google maps. Would this be possible as an overlay (also with such a large dataset or would I need to overlay an image?)
You could consider using PyQt and its Graphics Framework.
You would define classes for each type of item, inheriting from QGraphicsItem, then you just add these items to a QGraphicsScene, and leave the rendering itself to QGraphicsView. This is expected to be very performant.
As for Google Maps, you can export a subset of your data to KML, and render it using a KmlLayer, or you can use an ImageOverlay as you said, or else you can try the DataLayer API.
(As an alternative, you can embed a QWebKit widget pointing to GoogleMaps and overlay a QGraphicsView over it, but I think that would be a bit overkill).

Categories

Resources