What do you want to save?
Add Code snippet
New code examples
-
Other 2022-02-02 19:45:38
matplotlib join axes
import matplotlib.pyplot as plt fig, axs = plt.subplots(ncols=3, nrows=3) gs = axs[1, 2].get_gridspec() # remove the underlying axes for ax in axs[1:, -1]: ax.remove() axbig = fig.add_subplot(gs[1:, -1]) axbig.annotate('Big Axes \nGridSpec[1:, -1]', ... Add solution -
Python 2022-01-23 08:15:31
pyplot rectangle over image
import matplotlib.pyplot as plt import matplotlib.patches as patches from PIL import Image im = Image.open('stinkbug.png') # Create figure and axes fig, ax = plt.subplots() # Display the image ax.imshow(im) # Create a Rectangle patch rect = patches.Re... Add solution -
Other 2021-11-21 21:57:18
PCA with covariance
import numpy as npimport pandas as pdimport seaborn as snsimport matplotlib.pyplot as plt# Load datasetdataset = pd.read_csv('src/dataset.csv')pca = PCA(dataset, standardize=True, method='eig')normalized_dataset = pca.transformed_data# Covariance Matrix# ... Add solution -
Python 2021-11-20 09:17:57
central limit theorem python example
import numpy as npimport matplotlib.pyplot as pltdef repeat_sample_draws_exponential(n, samp_size, mu, show_all=False): means = [] samples = [] for ii in range(0, n): samples.append(np.random.exponential(mu, samp_size)) means.append... Add solution -
Python 2021-11-20 00:32:16
plt subplots figsize
f, axs = plt.subplots(2,2,figsize=(15,15)) Add solution