This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%matplotlib inline | |
import matplotlib.pyplot as plt | |
import matplotlib.dates as mdates | |
import pandas as pd | |
import numpy as np | |
#load datafile | |
url1 = 'https://sabopy.com/py/barchart_1' | |
data = pd.read_html(url1,header=0)[0] | |
data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
# AWS cloud9 | |
import matplotlib | |
matplotlib.use("Agg") | |
import matplotlib.pyplot as plt | |
import pandas as pd | |
from matplotlib.offsetbox import OffsetImage, AnnotationBbox | |
plt.rcParams["font.size"] = 16 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import glob | |
import pandas as pd | |
datafile_list = glob.glob('data/*.xlsx') | |
datafile_list | |
''' | |
['data/Dino_2018_0930_.xlsx', | |
'data/Dino_2018_0909_1002.xlsx', | |
'data/Dino_2018_0923_0929.xlsx', | |
'data/Dino_2018_0916_0922.xlsx'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
# AWS cloud9 | |
import matplotlib | |
matplotlib.use("Agg") | |
import matplotlib.pyplot as plt | |
from scipy.optimize import curve_fit | |
import numpy as np | |
x_data = np.linspace(-10, 10, 20) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ArtistAnimation | |
from mpl_toolkits.mplot3d import Axes3D | |
import matplotlib.pyplot as plt | |
import numpy as np | |
from IPython.display import HTML | |
import matplotlib.animation as animation | |
def generate(X, Y, phi): | |
R = 1 - np.sqrt(X**2 + Y**2) | |
return np.cos(2 * np.pi * X + phi) * R |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from mpl_toolkits.mplot3d import axes3d | |
import matplotlib.pyplot as plt | |
from IPython.display import HTML | |
import matplotlib.animation as animation | |
fig = plt.figure() | |
ax = fig.add_subplot(111, projection='3d') | |
# load some test data for demonstration and plot a wireframe | |
X, Y, Z = axes3d.get_test_data(0.1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%matplotlib inline | |
import matplotlib.pyplot as plt | |
import numpy as np | |
from mpl_toolkits.mplot3d import Axes3D | |
def midpoints(x): | |
sl = () | |
for i in range(x.ndim): | |
x = (x[sl + np.index_exp[:-1]] + x[sl + np.index_exp[1:]]) / 2.0 | |
sl += np.index_exp[:] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#picture scatter plot | |
%matplotlib inline | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from matplotlib.offsetbox import OffsetImage, AnnotationBbox | |
def imscatter(x, y, image, ax=None, zoom=1): | |
if ax is None: | |
ax = plt.gca() | |
try: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from mpl_toolkits.mplot3d import Axes3D | |
import matplotlib.pyplot as plt | |
import matplotlib.animation as animation | |
from IPython.display import HTML | |
import numpy as np | |
fig = plt.figure(figsize=(6,6)) | |
ax = fig.gca(projection='3d') | |
ax.set_box_aspect((1,1,1)) | |
ax.set_xlim(-12, 12) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%matplotlib inline | |
import matplotlib.pyplot as plt | |
import numpy as np | |
from matplotlib.offsetbox import OffsetImage, AnnotationBbox | |
from IPython.display import HTML | |
from matplotlib.animation import FuncAnimation | |
fig, ax = plt.subplots(figsize=(16,9)) | |
image = 'cactus7.png' | |
image = plt.imread(image) |
OlderNewer