hope you are doing fine
i want to plotting an animated plot to watch a point go to its specific destination(the point could be a moving car though)
point location has specified with a numpy array that has an x and y in each row.
position_mat(point location) will be updated in each iteration
this animated plot should displayed on an other plot with its nodes and paths, the point will move on this plot.
any other method or thing that can do this work will be considered, thanks.
Related
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
I am making a 3-D Scatterplot with plotly in Python 3 and the Z-axis represents time. I would like to freeze that so that, when the using clicks around to rotate the plot, it spins on that axis, but that axis stays up and down. I'm not sure if it's possible, but that would be a great feature.
As it is, the oldest points are at the top (this is a genetic tree) and the newest are at the bottom. However, it's very easy to get this turned when clicking around the plot to rotate and then the time axis is going left-to-right or diagonal or something and it's a bit disorienting, especially for people who are not used to looking at complex visuals like this (i.e. my intended audience).
A first draft example: https://plot.ly/~seth127/6
Any help is greatly appreciated!
Thanks,
Seth
I would like to draw the trayectories of an industrial robot plotting lines in 3D. I have already something in mind but I am stuck because I want to plot points relative to different frames. I tried something but it is not very elegant. Sorry for not showing it here the source code, technical problems.
I will use matplotlib and Python to program it.
Question: Is there a function in matplotlib to draw relative points in 3D space?
Relative to what?
It is YOU who can best tell the coordinates of the point.
If you want to count everything relative to a p0(x0,y0) point, then you add the x0, y0 values to each point.
from matplotlib import pyplot as pl
points = [[2,2],[3,3],[4,4],[5,5]]
p0 = [3,3]
for p in points:
pl.plot(p[0]+p0[0], p[1]+p0[1], "r.")
print p[0]+p0[0], p[1]+p0[1]
pl.show()
If you use numpy then you can even add the p0 to a whole array storing the coordinates.
If you want to calculate each point relative to the previous one, then do so, just little change in the code.
I'm creating a plot with factorplot and then trying to add a subplot on top of each box. How can I get the x-axis locations of each individual box in the factor plot to put another line on top?
Maybe there's a way to get all the x-axis values of each box plot on the axes?
Here's my basic factor plot:
I want to add 1 subplot (the circle) in the middle of each box plot. However, I cannot figure out how to get the x-value of each box to properly space the points.
I see a lot of code for positions and offsets in the seaborn source that lays these out. However, I'm wondering if there is a more straight-forward method to get this information or at least approximate it.
As per #mwaskom's comments, you can use sns.stripplot() (and now also sns.swarmplot()) to include your data points with a data summary plot such as a box or violinplot.
I want to use a basemap figure as a background and plot things ontop. As the generation of the basemap figure (a polar stereographic plot) is quite time intensive I only want to do this once.
The second step would be to draw some wind barbs on this plot and some other wind barbs on the same plot, but without the first set of barbs.
Now either I copy the background image and then draw two different images or I can remove the first set of barbs and then draw the second, I don't mind which way to go.
Unfortunately my brain is not helping me today and I am getting nowhere. I would be grateful for any tips.
If the new barbs will be in the same place you can use set_UVC to update the existing object with the new wind data.
Assuming m is your basemap object, something like:
n_barb,s_barb = m.barbs(...)
#some code
n_barb.set_UVC(newU,newV,newC)
I don't have wind data to test this on though.