What do you want to save?
Add Code snippet
New code examples
-
Python 2022-01-29 07:42:13
Image to grayscale using python
import numpy as np import matplotlib.pyplot as plt import matplotlib.image as mpimg def rgb2gray(rgb): return np.dot(rgb[...,:3], [0.299, 0.587, 0.144]) img = mpimg.imread('img.png') gray = rgb2gray(img) plt.imshow(gray, cmap='gray') plt.savefig(... 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-19 13:36:21
python how to save a Seaborn plot into a file
# Basic syntax: plt.savefig("output.png") # Example usage: plt.figure() plt.plot(range(5)) plt.savefig("output.png", dpi=300) # Note, savefig comes from matplotlib.pyplot and plt is an # abbreviation for this, e.g. import matplotli... Add solution -
Python 2021-11-17 10:43:09
pyplot savefig
import matplotlib.pyplot as plt # creating plotting data xaxis, yaxis =[1, 4, 9, 16, 25, 36, 49, 64, 81, 100], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] # plotting plt.plot(xaxis, yaxis) # saving the file.Make sure you # use savefig() before show(). plt.... Add solution -
Python 2021-11-14 14:49:14
simulate robot arm using python
import math import matplotlib.pyplot as plt l1 = 0.8 l2 = 0.5 n_theta = 10 # No of divisions theta_start = 0 # Starting angle theta_end = math.pi/2 # Ending angle theta1 = [] theta2 = [] for i in range(0,n_theta): theta1.append(theta_start+ (theta_e... Add solution
Best helpers
+5
+5
+5
+5
+5
+5
+5
+5
+5