What do you want to save?
Add Code snippet
New code examples
-
TypeScript 2021-09-28 22:04:04
dist subplots in seaborn python
import numpy as np import seaborn as sns import matplotlib.pyplot as plt sns.set(style="white", palette="muted", color_codes=True) rs = np.random.RandomState(10) # Set up the matplotlib figure f, axes = plt.subplots(2, 2, figsize=(7,... Add solution -
Python 2021-09-28 21:03:03
matplotlib multiple plots with different size
import numpy as np import matplotlib.pyplot as plt # generate some data x = np.arange(0, 10, 0.2) y = np.sin(x) # plot it f, (a0, a1) = plt.subplots(1, 2, gridspec_kw={'width_ratios': [3, 1]}) a0.plot(x, y) a1.plot(y, x) f.tight_layout() f.savefig('gr... Add solution -
Other 2021-09-28 09:24:02
Examples using matplotlib.pyplot.quiver
''' ======================================================== Demonstration of advanced quiver and quiverkey functions ======================================================== Known problem: the plot autoscaling does not take into account the arrows, so t... Add solution -
Python 2021-09-27 11:22:02
python wordcloud
from wordcloud import WordCloud, STOPWORDS import matplotlib.pyplot as plt text = 'Python Kurs: mit Python programmieren lernen für Anfänger und Fortgeschrittene Dieses Python Tutorial entsteht im Rahmen von Uni-Kursen und kann hier kostenlos g... Add solution -
Python 2021-09-27 10:19:02
plot 3d python
#import pyplot and Axes3D import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D #plotting a scatter for example fig = plt.figure() ax = fig.add_subplot(111,projection = "3d") ax.scatter(xs = data["x"], ys = data[&quo... Add solution -
Other 2021-09-27 09:15:03
open cverror: (-215:Assertion failed) src.type() == CV_8UC1 in function 'cv::adaptiveThreshold'
from keras.preprocessing import image import cv2 import matplotlib.pyplot as plt img = image.load_img('15f8U.png', grayscale=True, target_size=(224, 224)) img = image.img_to_array(img, dtype='uint8') print(img.shape) ## output : (224,224,3) #plt.imshow(... Add solution -
Python 2021-09-26 23:44:03
sklearn roc curve
import sklearn.metrics as metrics # calculate the fpr and tpr for all thresholds of the classification probs = model.predict_proba(X_test) preds = probs[:,1] fpr, tpr, threshold = metrics.roc_curve(y_test, preds) roc_auc = metrics.auc(fpr, tpr) # method ... Add solution