# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

# ## Jupyter Notebook test  
#  
# Uploaded 10/19/2019 

# +
# !python -V

import numpy as np
import matplotlib.pyplot as plt
# %matplotlib notebook

# -

from mpl_toolkits import mplot3d
fig = plt.figure()
ax = plt.axes(projection='3d')

# +
ax = plt.axes(projection='3d')

# Data 3d
zline = np.linspace(0, 15, 1000)  # linearly spaced, 0 to 15, 1000 points)
xline = np.sin(zline)  # sine of zline
yline = np.cos(zline)  # cosine of zline 
ax.plot3D(xline, yline, zline,  'gray')

# Data for scattered points along the line-spiral

zdata = 15 * np.random.random(100)  # 100 random points along z-axis.
xdata = np.sin(zdata) + 0.1 * np.random.randn(100)  # random perturbation on x-axis.
ydata = np.cos(zdata) + 0.1 * np.random.randn(100)  # random perturbation on y-axis.
# Spelling change from Github edit window -- worked!  Did not corrupt my Jupyter notebook.  

ax.scatter3D(xdata, ydata, zdata, c=zdata, cmap='Greens');


# -

# ### 3D Contour Plots

# +
def f(x, y):
    return np.sin(np.sqrt(x**2 + y**2)) # sine wave of circle.

x = np.linspace(-6, 6, 30)  # linearly spaced line, -6 to +6, 30 points.
y = np.linspace(-6, 6, 30)

X, Y = np.meshgrid(x, y)
Z = f(X, Y)

# +
# Plotting - MatLab style

fig = plt.figure()
ax = plt.axes(projection='3d')
ax.contour3D(X, Y, Z, 50, cmap='binary')
ax.set_xlabel('x')
ax.set_ylabel('y')
ax.set_zlabel('z')

# Increase viewing tilt and rotate 
ax.view_init(60, 35);

# -















StarcoderdataJupyterScriptsDedupFiltered