What do you want to save?
Add Code snippet
New code examples
-
Other 2021-10-18 18:40:12
matplotlib pie chart label order
import matplotlib.pyplot as plt import pandas as pd #corresponding color-label pairs colors = ['#99f3bd', '#fbaccc', '#a8df65', '#ff7b54'] labels = ["Yes", "Sometimes", "Most of the times", "No"] #... Add solution -
Python 2021-10-17 19:48:11
fnd closest element in array numpy
import numpy as np def find_nearest(array, value): array = np.asarray(array) idx = (np.abs(array - value)).argmin() return array[idx] array = np.random.random(10) print(array) # [ 0.21069679 0.61290182 0.63425412 0.84635244 0.91599191 0.... Add solution -
Python 2021-10-09 16:14:09
matplotlib twinx legend
import numpy as np import matplotlib.pyplot as plt from matplotlib import rc rc('mathtext', default='regular') time = np.arange(10) temp = np.random.random(10)*30 Swdown = np.random.random(10)*100-10 Rn = np.random.random(10)*100-10 fig = plt.figure() a... Add solution -
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
Best helpers
Ranking is empty