Open AlexanderJuestel opened 3 years ago
This is awesome and I want to provide some help but am lacking time at the moment. Hopefully, these tips help:
Is there a way to combine the single spheres like done for the lines in #310
Yep, you can either merge all the spheres into a single unstructured grid or put them all in a MultiBlock dataset. Since you already have the spheres as a list, you can just pass that to the MultiBlock
constructor:
spheres = pv.MultiBlock([pv.Sphere(radius=data_df.loc[i]['Magnitude']*200, center=data_df.loc[i][['X', 'Y', 'Z']].tolist()) for i in range(len(data_df))])
...
# Remove the for loop plotting
p.add_mesh(spheres, scalars='Magnitude', cmap='Reds', clim=[0,6],scalar_bar_args=sargs)
then somehow plot the data by year by adjusting a slider?
See if you can create a multiblock like this for each year. Then track which data to show by having some sort of class that will hold all of that data and have callbacks for updating the data shown in the viewer.
At the moment, we only have slider widgets to control the timestep but we could add this time widget: https://vtk.org/Wiki/File:PlaybackWidget.png
Otherwise, I'd use ipywdigets or a qt interface with BackgroundPlotter
Hope this helps!
Description
Hello,
I would like to plot earthquake data as Time Series with PyVista, ideally having a slider or a sort of "play button" to start adding data. The data used for the slider would be the year the earthquake occured. So while time progresses, more and more events should appear in the plotting window.
Example Data
I have attached the sample data.
What I have accomplished so far is plotting each single event as sphere and adjust its size and color to the magnitude of the event. Is there a way to combine the single spheres like done for the lines in #310 and then somehow plot the data by year by adjusting a slider?
Looking forward to some hints and tipps :)
earthquakes_aachen.txt