What do you want to save?
Add Code snippet
New code examples
-
Other 2021-09-09 06:07:01
display values on 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 -
Other 2021-09-08 22:59:02
percentage stacked bar chart sns
# import libraries import seaborn as sns import numpy as np import matplotlib.pyplot as plt import matplotlib.patches as mpatches # load dataset tips = sns.load_dataset("tips") # set the figure size plt.figure(figsize=(14, 14)) # from raw val... Add solution -
Python 2021-09-08 04:23:03
matplotlib add legend axis x
fig = plt.figure(figsize=(10,5)) ax = fig.add_subplot(111) ax.set_title('ADR vs Rating (CS:GO)') ax.scatter(x=data[:,0],y=data[:,1],label='Data') plt.plot(data[:,0], m*data[:,0] + b,color='red',label='Our Fitting Line') ax.set_xlabel('ADR') ax.set_ylabel... Add solution -
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