Replotting result of find_contours onto a different grid - python

I have used the skimage find_contours on some velocity data but I am struggling to work out how to replot the contour outline onto a longitude latitude grid ?
I think it is some sort of transform in coordinates but I am struggling to work out how.

Related

Slice plot in vtk

I have a polydata file containing 3D coordinates of the mesh (as vtkPoints) and temperature at each point as an attribute. I want to plot the temperature as a slice plot (at three elevations) over the geometry. I managed to get the data slices at different elevation using vtkClipPolyData function. However, I am unable to find a good example showing how to interpolate the value at each of these points and plot the data. Really appreciate if someone can help me on this.
I tried to render the clipped data directly by increasing the point size from actor property,
actor.GetProperty().SetPointSize(5)
however, this gives a pixelated plot. See plot here

How to draw a border around datapoints of the same cluster in Matplotlib

I wonder if there is a way to draw a border around data points of the same cluster (same label) in a scatter plot, using Matplotlib? I mean borders, like in the attached image.
The keyword I was searching for was Convex Hulls. Scipy offers a class that can easily calculate the Convex Hull of a list of data points.
The code in this post was quite helpful: Plotting a set of given points to form a closed curve in matplotlib

Change the canvas's shape when using Lambert Conformal Projection

With the supporting of matplotlib basemap, I can draw my netCDF files in different kind of projection type.
We always see the figure is in rectangular showing like this:
But I also see some figures showing like:
For now, I have some weather simulation data and I want to represent it on the map with Lambert projection.
The temperature of on time slice shows like:
So, here is my question:
How to generate the figure which the borders of the canvas fit the lcc projection like the previous one using Basemap?

Plotting 2D satellite profile data in 3D over earth projection in Python

I am attempting to do something similar to this:
sample ozone profile
Not necessarily over an orthographic projection - a cube over a map would suffice.
I'm able to plot the PolyCollection object produced by matplotlib.pyplot.pcolor, but cannot figure out if there's an accepted way of plotting the profile over an arbitrary lat/lon path.
The only thing I can think of right now is continuing to use pcolor() to get the face colors, then just modifying the vertices for each Poly object.
If you want to create a 3D projection, then you may use the plot_surface. It essentially draws a 2D array where the 3D coordinates of each vertex is given.
You might get some ideas by looking at this: Creating intersecting images in matplotlib with imshow or other function
The matplotlib solution there is essentially the same as using pcolor, but the 3D arithmetics is carried out by matplotlib. The suggestion to use mayavi is also something worth conisdering, as matplotlib is not at its strongest with 3D projected raster data.

generate an arbitrary angled contour from 3D data points

I am wondering if there is a way to generate 2d contour plots from a set of 3D data points using either python or matlab? The 3D data points create a roughly spherical shape and the contour would represent the outer border of this spheroid on different planes angled from 0 to 180 degrees
I am thinking one way is to generate a 3D surface from the pointcloud by using numpy.meshgrid and then using plot_surface. However, I also do not find a way to take angled slices out of the interpolated 3D data to obtain a contour.
Ideas very welcome!
thanks
Jesse

Categories

Resources