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 numpy as np | |
import matplotlib.pyplot as plt | |
lines = [] | |
styles = ['-', '--', '-.', ':'] | |
x = np.linspace(0, 10, 1000) | |
fig, ax = plt.subplots() | |
for i in range(4): | |
lines += ax.plot(x, np.sin(x - i * np.pi / 2), |
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 matplotlib.pyplot as plt | |
import matplotlib.gridspec as gridspec | |
from matplotlib.widgets import Button | |
def on_click(event): | |
print("hey") | |
fig = plt.figure(constrained_layout=True) | |
gs = gridspec.GridSpec(2, 1, height_ratios=[14, 1], figure=fig) |
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 matplotlib.pyplot as plt | |
from matplotlib.animation import FuncAnimation | |
numHeatMaps = 2 | |
measurements = [[(i + 1, j + 1, k * 100 + i * 10 + j) for i in range(5) for j in range(5)] for k in range(numHeatMaps)] | |
fig, ax = plt.subplots() | |
im = ax.imshow(measurements[0]) | |
def update(i): |
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
# Code was written in an answer to this Stackoverflow question: | |
# http://stackoverflow.com/questions/42045921/why-does-pyplot-contour-require-z-to-be-a-2d-array | |
import matplotlib.pyplot as plt | |
from matplotlib.widgets import Slider | |
import numpy as np | |
fig, (ax, ax2) = plt.subplots(ncols=2, figsize=(6,3.7) ) | |
plt.subplots_adjust(left=0.05, right=0.95, bottom=0.05, top=0.82, wspace=0.07) | |
def setup(): |