summaryrefslogtreecommitdiff
path: root/doc/source/user/plots/matplotlib3.py
diff options
context:
space:
mode:
authorAnne Bonner <35413198+bonn0062@users.noreply.github.com>2020-01-21 07:32:42 -0800
committerRalf Gommers <ralf.gommers@gmail.com>2020-01-21 16:32:42 +0100
commitc3441dfb3fdde09008b19a2998331d3fc2dd0cd1 (patch)
tree997bfe1940cf5f207c93bf709de7c7f15d4a39a3 /doc/source/user/plots/matplotlib3.py
parentbe8f93cbfd5cec2f58bc15a54e602f74bd908ab3 (diff)
downloadnumpy-c3441dfb3fdde09008b19a2998331d3fc2dd0cd1.tar.gz
DOC: NumPy for absolute beginners tutorial (#14546)
This absolute beginners tutorial is the output of Anne's Google Season of Docs project. An intermediate version was also published at https://towardsdatascience.com/the-ultimate-beginners-guide-to-numpy-f5a2f99aef54
Diffstat (limited to 'doc/source/user/plots/matplotlib3.py')
-rw-r--r--doc/source/user/plots/matplotlib3.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/doc/source/user/plots/matplotlib3.py b/doc/source/user/plots/matplotlib3.py
new file mode 100644
index 000000000..af778979b
--- /dev/null
+++ b/doc/source/user/plots/matplotlib3.py
@@ -0,0 +1,16 @@
+import numpy as np
+import matplotlib.pyplot as plt
+from matplotlib import cm
+from mpl_toolkits.mplot3d import Axes3D
+
+fig = plt.figure()
+ax = Axes3D(fig)
+X = np.arange(-5, 5, 0.15)
+Y = np.arange(-5, 5, 0.15)
+X, Y = np.meshgrid(X, Y)
+R = np.sqrt(X**2 + Y**2)
+Z = np.sin(R)
+
+ax.plot_surface(X, Y, Z, rstride=1, cstride=1, cmap='viridis')
+
+plt.show() \ No newline at end of file