Thanks, I didn't realize matplot already had myavi-like 3d plotting built in. For my system, it was necessary to change your import of "Axes3d" to "axes3d". Don't know if it changed or you have a case-insensitive python or something.
Hey, thanks for the great video, I have couple of queries: Q.) What is the limit of Matplotlib in terms of number of data points that can be printed? When I try with 50,000 data points it takes long time, after 1 lakh data item, it does not even show up? Are there any thresholds mentioned in documentation?
Thank you so much for all your tutorials, they've been super helpful. Do you happen to have any video on graphing surfaces from xyz points? Sort of like spline (u did the smoothing video for 2D) but for 3D. I haven't been able to find it among your videos.
Dear all, Thank you for the video. I was wondering whether one could apply the same concepts of your video in order to plot a 4D data (x= longitude, y=latitude, z=time, k=attribute value) in a 3D matplotlib structure. The color of the plot would be the Kth dimension, an alpha (transparency) parameter would be needed in order to be able to visualize the data within the data. Typical cases can be found in Astronomy and remote sensing science. Typical file formats that store that kind of info are NETCDF and HDF. I thank you for your time, Sincerely yours, Philipe Leal
Hi can I do this with RGB values? X = [1,2,3,4] Y = [1,2,3,4] Z = [1,2,3,4] C = np.array([[0, 0, 0], [0, 0, 128], [255, 255, 102],[0, 7, 65]]) fig = plt.figure() ax = fig.add_subplot(111, projection = '3d') ax.scatter(X, Y, Z, c = C/255.0) ax.set_xlabel('x axis') ax.set_ylabel('y axis') ax.set_zlabel('z axis') plt.show() this but place my whole RGB colour list in C parameter? And changew X, Y, Z to n=(how many are in the list)
Dear Sentdex, I am new to matlab and these plotting softwares, I have a text file and I am interested in plotting the xyz in a 3d scatter plot. I have followed your tutorial ans I have installed matplot along with NUMpy and everything. I was thinking that it works with matlab as a tool. but I could not make it work. its been my 3rd day and i have wasted a lot of time. a little help would save me more time. thanking you in anticipation.
yeah i got it now. your tutorials are helpful. Thank you. Could you please upload a tutorial to read XYZ data from a file and make a plot like this one?
@@sentdex Hi, I Have actually made it worked as the tutorial showed. But now I'm trying to plot with my own dataset, and it tells me an error "shape mismatch: objects cannot be broadcast to a single shape", arguably Im using a very messy data, as in the XYZ I now use is; endingMerchantSales = [100,639,3068,14727,70692,339325,1628777,7818186] salesPL = [24500,133164.4,384675.168,1546967.643,6225678.340,29571844.556,129179928.610,612495651.837] salesMultiplier = [ 16.33 , 21.47 , 23.97 , 26.52 , 26.52 , 27.79 , 27.79 ] as in those are my XYZ Do you know of any possible solution to this? or maybe I should specified the range of each axis? would that help?
+danish sodhi You cannot embed a matplotlib interactive graph in html like this. You might be able to find some sort of javascript emulator for matplotlib, but that'd be messy. you're better off implementing something like: www.highcharts.com/demo/3d-scatter-draggable For implementing highcharts example: pythonprogramming.net/adding-js-plugins-flask-highcharts-example/
Thank you. This relay help me. But to how make it dynamic? I want to make it read x,y and z position from file, each row in file is one frame and three columns corresponding to x,y,z. This is my file looks like: 1 1 1 1 7 3 4 2 4 This is my file fig = plt.figure() ax = fig.add_subplot(111, projection='3d') x = []; y = []; z=[]; with open('3dplot.csv', 'rb') as csvfile: spamreader = csv.reader(csvfile, delimiter=',', quotechar='|') for row in spamreader: print row x.append(int(row[0])) y.append(int(row[1])) z.append(int(row[2])) ax.scatter(x,y,z,c='r',marker='o') ax.set_xlabel('x axis') ax.set_ylabel('y axis') ax.set_zlabel('z axis') plt.show() Thank you.
Mate, you are the best python developer in youtube?
Intro is very satisfying
This is a very informative video. Thanks for posting. I was wondering how to do plot for float numbers?
If I want to create surface and join all points themselve how do I need to proceed
Thanks, I didn't realize matplot already had myavi-like 3d plotting built in. For my system, it was necessary to change your import of "Axes3d" to "axes3d". Don't know if it changed or you have a case-insensitive python or something.
Hi ! Is it possible to rotate 3D plots by hand on jupyter ? It doesn't work on my side so I don't know if it's possible.
Thanks !
I want to know too, did you find out?
Yes, but if you have an inline plot, then you might not do that. (Probably)
Hey, thanks for the great video, I have couple of queries:
Q.) What is the limit of Matplotlib in terms of number of data points that can be printed? When I try with 50,000 data points it takes long time, after 1 lakh data item, it does not even show up? Are there any thresholds mentioned in documentation?
This is so cool. I might try this out now
Thanks for this. It helped me a lot!
Great to hear
Thank you so much for all your tutorials, they've been super helpful. Do you happen to have any video on graphing surfaces from xyz points? Sort of like spline (u did the smoothing video for 2D) but for 3D. I haven't been able to find it among your videos.
Thx, quickest way to do this.
Dear all,
Thank you for the video.
I was wondering whether one could apply the same concepts of your video in order to plot a 4D data (x= longitude, y=latitude, z=time, k=attribute value) in a 3D matplotlib structure. The color of the plot would be the Kth dimension, an alpha (transparency) parameter would be needed in order to be able to visualize the data within the data.
Typical cases can be found in Astronomy and remote sensing science. Typical file formats that store that kind of info are NETCDF and HDF.
I thank you for your time,
Sincerely yours,
Philipe Leal
I can't understand how will it be visualized ?
Hi I love your tutorial! I have a question, I'm trying to plot scatter points in 3D space with updating, do you have any suggestion for that? :)
Excellent. Thanks for this! Very helpful
How can we add a categorical value to the points...say we have values for target 0 and 1 and we want to add that dimension too and color the plot.
thank you for sharing. Not even excel,matlab,mathematica have a good plot 3d like this simple program.
Why there are different red colors? We just specified one red color.
he answers that at 4:22
it basically shows how close each indvidual dot is to the viewer
@@ichias16 Yeah, thanks.
I have graph network how do I plot it in 3d...what must be the values of Z axis for the graph?
You are so amazing! thanks a lot!
Sir how to get different markers in scatter plot without using subplots
Hi can I do this with RGB values?
X = [1,2,3,4]
Y = [1,2,3,4]
Z = [1,2,3,4]
C = np.array([[0, 0, 0], [0, 0, 128], [255, 255, 102],[0, 7, 65]])
fig = plt.figure()
ax = fig.add_subplot(111, projection = '3d')
ax.scatter(X, Y, Z, c = C/255.0)
ax.set_xlabel('x axis')
ax.set_ylabel('y axis')
ax.set_zlabel('z axis')
plt.show()
this but place my whole RGB colour list in C parameter? And changew X, Y, Z to n=(how many are in the list)
how to convert from x y z to stl? using python scripts? or how to make vertics from x y z coordinate using python?
How do you rotate your images? IDE specific maybe?
No, just drag. If you are using a notebook, and if you have inline plot, you might not rotate...
add this to notebook
and it will rotate :
%matplotlib
# rotate the axes and update
for angle in range(0, 360):
ax.view_init(30, angle)
plt.draw()
Thank you, this was useful.
Happy to share!
How to zoom, pan,how to change the center of rotation
Dear Sentdex, I am new to matlab and these plotting softwares, I have a text file and I am interested in plotting the xyz in a 3d scatter plot. I have followed your tutorial ans I have installed matplot along with NUMpy and everything. I was thinking that it works with matlab as a tool. but I could not make it work. its been my 3rd day and i have wasted a lot of time. a little help would save me more time. thanking you in anticipation.
Rizwan Khan Matplotlib and Python are their own things entirely, separate from matlab.
yeah i got it now. your tutorials are helpful. Thank you.
Could you please upload a tutorial to read XYZ data from a file and make a plot like this one?
you are the best. thank you very much
it doesnt work with jupyter notebook?
Since notebook doesnt show. You can try the %matplotlib inline magic and maybe that'll help
@@sentdex Hi, I Have actually made it worked as the tutorial showed. But now I'm trying to plot with my own dataset, and it tells me an error "shape mismatch: objects cannot be broadcast to a single shape",
arguably Im using a very messy data, as in the XYZ I now use is;
endingMerchantSales = [100,639,3068,14727,70692,339325,1628777,7818186]
salesPL = [24500,133164.4,384675.168,1546967.643,6225678.340,29571844.556,129179928.610,612495651.837]
salesMultiplier = [ 16.33 , 21.47 , 23.97 , 26.52 , 26.52 , 27.79 , 27.79 ]
as in those are my XYZ
Do you know of any possible solution to this? or maybe I should specified the range of each axis? would that help?
Hey ,
Can you please help in how can I embedd these 3D plots in HTML . I am using Flask framework .
Thanks in advance :)
+danish sodhi You cannot embed a matplotlib interactive graph in html like this. You might be able to find some sort of javascript emulator for matplotlib, but that'd be messy. you're better off implementing something like: www.highcharts.com/demo/3d-scatter-draggable
For implementing highcharts example: pythonprogramming.net/adding-js-plugins-flask-highcharts-example/
+sentdex Can highcharts handle millions of data points?
you can. Save a graph as a file and then put in html...
@@StreetDogWrangler yes
Many thanks.
dude if you know we use data from a file why you keed doing it like the manuals ffs
thank you so much! :)
Thank you. This relay help me. But to how make it dynamic?
I want to make it read x,y and z position from file, each row in file is one frame and three columns corresponding to x,y,z.
This is my file looks like:
1 1 1
1 7 3
4 2 4
This is my file
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
x = []; y = []; z=[];
with open('3dplot.csv', 'rb') as csvfile:
spamreader = csv.reader(csvfile, delimiter=',', quotechar='|')
for row in spamreader:
print row
x.append(int(row[0]))
y.append(int(row[1]))
z.append(int(row[2]))
ax.scatter(x,y,z,c='r',marker='o')
ax.set_xlabel('x axis')
ax.set_ylabel('y axis')
ax.set_zlabel('z axis')
plt.show()
Thank you.