What do you want to save?
Add Code snippet
New code examples
-
Other 2021-10-12 09:54:05
seaborn countplot
plt.figure(figsize=(12,8)) ax = sns.countplot(x="AXLES", data=dfWIM, order=[3,4,5,6,7,8,9,10,11,12]) plt.title('Distribution of Truck Configurations') plt.xlabel('Number of Axles') plt.ylabel('Frequency [%]') for p in ax.patches: ax.ann... 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 -
Python 2021-10-07 17:17:08
label axis matplotlib
# Basic syntax: plt.xlabel("X axis label") # Add ", fontsize = #" to control fontsize plt.ylabel("Y axis label") # Example usage: plt.plot(range(5)) plt.xlabel("X axis label") plt.ylabel("Y axis label") p... Add solution -
Python 2021-10-06 23:49:03
bar labeling in matplotlib
import matplotlib.pyplot as plt %matplotlib inline plt.style.use('ggplot') x = ['Nuclear', 'Hydro', 'Gas', 'Oil', 'Coal', 'Biofuel'] energy = [5, 6, 15, 22, 24, 8] x_pos = [i for i, _ in enumerate(x)] plt.bar(x_pos, energy, color='green') plt.xlabel(&q... Add solution -
Python 2021-10-06 12:08:04
python line chart
import matplotlib.pyplot as plt Year = [1920,1930,1940,1950,1960,1970,1980,1990,2000,2010] Unemployment_Rate = [9.8,12,8,7.2,6.9,7,6.5,6.2,5.5,6.3] plt.plot(Year, Unemployment_Rate) plt.title('Unemployment Rate Vs Year') plt.xlabel('Year') plt.ylab... Add solution -
Python 2021-10-04 03:09:02
logarithmic scale fitting python
fig=plt.figure() ax = fig.add_subplot(111) z=np.arange(1, len(x)+1) #start at 1, to avoid error from log(0) logA = np.log(z) #no need for list comprehension since all z values >= 1 logB = np.log(y) m, c = np.polyfit(logA, logB, 1, w=np.sqrt(y)) # fi... Add solution