3D Graphs in Matplotlib for Python: Basic 3D Line

preview_player
Показать описание
Once you get comfortable with the 2D graphing, you might be interested in learning how to plot three-dimensional charts. 3D graphs add more perspective and comparison to your charts, and just plain look cool! Luckily for us, 3D graphs are pretty easy to learn and program with Matplotlib.

Here is some quick and simple, with hard-coded values, for a 3-D matplotlib wire chart.

Link to the full playlist:

How to make a basic 3D line graph with Matplotlib in python
Рекомендации по теме
Комментарии
Автор

I tried this but it showed: AttributeError: 'list' object has no attribute 'ndim'

frankelindddd
Автор

Traceback (most recent call last):
File "C:/Users/ABC/App Demo/Plot 3D/matplotlib plot 3D.py", line 16, in <module>
ax.plot_wireframe(X, Y, X)
File "C:\Users\ABC\App Demo\Plot 3D\venv\lib\site-packages\mpl_toolkits\mplot3d\axes3d.py", line 1806, in plot_wireframe
if Z.ndim != 2:
AttributeError: 'list' object has no attribute 'ndim'
how to fix this error?

nostrajara
Автор

Can this video be updated to a more recent version. "positional arguments to plot_wireframe() are deprecated since 3.4 ". Thanks.

SisHattie
Автор

I find this error: AttributeError: 'function' object has no attribute 'add_subplot' I check matplotlib folder and subplot is there. why does it show traceback @Sentdex?

sultanislam
Автор

How do you specify the color of the graph?

fosheimdet
Автор

How do i make python 2.7 from anaconda to display the figure box instead of displaying it in the IPython terminal?

kindle
Автор

Code isn't working new version is like this.

fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')

X, Y, Z = [ int(ss[0][0]), int(ss[1][0]) ], [ int(ss[0][1]), int(ss[1][1]) ], [ int(ss[0][2]), int(ss[1][2]) ]
ax.plot(X, Y, Z, 'blue')

i have list named ss.

himanskss
Автор

How can plot string data an this 3d graph? Because I. Getting error while ploting string data on this 3d graph

suchitagaikwad
Автор

hi, im not sure whether if i could change each points in 3d chart.

minkim
Автор

Sentdex, the code doesn't work right now

DistortedV
Автор

Traceback (most recent call last):
File "C:\Users\A 455L\Desktop\Python\ujicoba.py", line 10, in <module>
chart.plot_wireframe(X, Y, Z)
File "C:\Python36\lib\site-packages\mpl_toolkits\mplot3d\axes3d.py", line 1848, in plot_wireframe
if Z.ndim != 2:
AttributeError: 'list' object has no attribute 'ndim'

can you solve it? please...

rendianwar
Автор

use plot instead of plot_wireframe and everything will be ok

talkingbirb
Автор

Hi, Is there possibility to share those 3D charts in browser window using for example django web framework? But keep them responsive, not as .png?
Thanks.

szekspirr