What do you want to save?
Add Code snippet
New code examples
-
Python 2021-09-07 18:58:03
Grouped bar chart with labels
fig, ax = plt.subplots(figsize=(12, 8)) x = np.arange(len(df.job.unique())) # Define bar width. We'll use this to offset the second bar. bar_width = 0.4 # Note we add the `width` parameter now which sets the width of each bar. b1 = ax.bar(x, df.loc[df['... Add solution -
Python 2021-08-31 15:09:01
change ticks font size matplotlib python
from matplotlib import pyplot as plt from datetime import datetime, timedelta xvalues = range(10) yvalues = xvalues fig,ax = plt.subplots() plt.plot(xvalues, yvalues) plt.xticks(fontsize=16) # sets font size of xticks to 16 (respective of yticks) plt.... Add solution -
Go 2021-08-30 19:28:01
matplotlib logo image on a plot
import matplotlib.image as image import matplotlib.pyplot as plt im = image.imread('debian-swirl.png') fig, ax = plt.subplots() ax.imshow(im, aspect='auto', extent=(0.4, 0.6, .5, .7), zorder=-1) ax.yaxis.tick_left() ax.tick_params(axis='y', colors='black... Add solution -
C 2021-08-28 10:37:02
plt circle
import matplotlib.pyplot as plt circle1 = plt.Circle((0, 0), 0.2, color='r') circle2 = plt.Circle((0.5, 0.5), 0.2, color='blue') circle3 = plt.Circle((1, 1), 0.2, color='g', clip_on=False) fig, ax = plt.subplots() # note we must use plt.subplots, not pl... Add solution