What do you want to save?
Add Code snippet
New code examples
-
Python 2022-01-26 00:01:21
matplotlib: use colormaps for line plot colors
import numpy as np import matplotlib.pylab as plt plt.rcParams["figure.figsize"] = [7, 7] plt.rcParams["figure.autolayout"] = True x = np.array([0,1]) y = np.array([1,1]) n = 50 colors = plt.cm.hsv(np.linspace(0, 1, n)) for i in range(... Add solution -
Python 2021-11-21 19:03:18
python plot a dictionary
# credit to the Stack Overflow user in the source link import matplotlib.pylab as plt lists = sorted(d.items()) # sorted by key, return a list of tuples x, y = zip(*lists) # unpack a list of pairs into two tuples plt.plot(x, y) plt.show() Add solution -
Python 2021-10-10 05:14:07
Plotting keras model trainning history
history = model.fit() print(history.history.keys()) import matplotlib.pylab as plt from matplotlib.pyplot import figure figure(figsize=(8, 6)) plt.plot(history.history['loss']) plt.plot(history.history['val_loss']) plt.title('model loss') plt.ylabel('los... Add solution