简体   繁体   中英

python 3d plot of several sets of data under different conditions

I am trying to make a 3D plot of several sets of data.

Each data set has two parameters, current and position. I have made several individual scatter plots for each of the data sets.

Now I want to represent all of the data on one plot with an additional parameter.

I have taken each data set at a different time of the day, and I want to use a 3d plot to make the third axis the time of day.

I want to create something similar to a surface plot, that will look like several lines stacked behind each other according to the time the data was taken. How do I go about doing this? Is there a function I can use?

I should note that the time of day data is not already in the data sets. I would need to make a separate array with the time of day and correlate the time to its correct data set. Is there a simple way to do this, without having to add a parameter to each data set with the time?

[By this I mean I don't want to have to change each data point in all the data sets to something like (x1, y1, 2PM), (x2, y2, 2PM), (x3, y3, 2PM), . . . (x1, y1, 2PM), (x2, y2, 2PM), (x3, y3, 2PM), . . .

and on and on. This would be very annoying since each data set is quite large.]

When posting please include a description of what you have already tried/considered, including links to relevant StackOverflow questions (eg "I tried this but it wasn't quite what I wanted"). This helps us focus on the particulars of your problem.

You have several options. I would suggest checking out matplotlib. Jake VanderPlas has a very nice tutorial on 3d plotting here . Another nice tool is Plotly .

As far as organizing your data, you can keep the time in a separate array. But you do need to align it with your other data points. Eg, your position, current, and time arrays need to be of the same size and position[i], current[i], and time[i] represent the "i(th)" set of values. Each of the plotting tools above will allow you to pass in the 3 arrays individually.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM