subplot

Rotate Label Axis X in a specific subplot using sns.boxplot (seaborn)

Rotate xtick labels of a specific subplot Question: How to rotate in 90° the labels of X axis of subplot 222 (chart 2) and keep using sns.boxplot? fig = plt.figure(figsize=(12, 8)) # CHART 1 fig.add_subplot(221) #sns.countplot(df_train[‘MSZoning’]) sns.boxplot(x=’MSZoning’, y=’SalePrice’, data=df_train) # CHART 2 fig.add_subplot(222) #sns.boxplot(x=’MSZoning’, y=’SalePrice’, data=df_train) sns.boxplot(x=’Neighborhood’, y=’SalePrice’, data=df_train) # CHART 3 fig.add_subplot(223) #sns.boxplot(x=’Neighborhood’, y=’SalePrice’, …

Total answers: 1

How to have a figure legend and a subplot legend

How to have a figure legend and a subplot legend Question: I would like to plot some data in subplots and I would like to have a legend for the overall figure but also a legend for one of the subplots, where the labels of the subplot should not appear in the figure label. Here …

Total answers: 1

3 x 2 subplots in matplotlib using gridspec – Remove empty spacing?

Remove empty spacing between gridspec subplots Question: I am trying to create a plot in matplotlib with three subplots in the first column and two in the second. Using gridspec, I have managed to tweak it, but somehow there are large spacing between the different subplots in the first and second column. Ideally, they should …

Total answers: 1

How do I match the size of my colorbar with the subplots?

How do I match the size of my colorbar with the subplots? Question: I am trying to add one single colorbar to all my 4 subplots, I have gone through a lot of answers but the codes over there appear confusing to me and I am new to python and matplotlib The code I have …

Total answers: 1

How to increase plottable space above a subplot in matplotlib?

How to increase plottable space above a subplot in matplotlib? Question: I am currently making a plot on matplotlib, which looks like below. The code for which is: fig, ax1 = plt.subplots(figsize=(20,5)) ax2 = ax1.twinx() # plt.subplots_adjust(top=1.4) ax2.fill_between(dryhydro_df[‘Time’],dryhydro_df[‘Flow [m³/s]’],0,facecolor=’lightgrey’) ax2.set_ylim([0,10]) AB = ax2.fill_between(dryhydro_df[‘Time’],[12]*len(dryhydro_df[‘Time’]),9.25,facecolor=colors[0],alpha=0.5,clip_on=False) ab = ax2.scatter(presence_df[‘Datetime’][presence_df[‘AB’]==True],[9.5]*sum(presence_df[‘AB’]==True),marker=’X’,color=’black’) # tidal heights ax1.plot(tide_df[‘Time’],tide_df[‘Tide’],color=’dimgrey’) I want the blue shaded …

Total answers: 1

Supblots to include radar plot

Supblots to include radar plot Question: I’m running into issues with some subplots. I’ve provided some sample code to generate the types of plots I would like to create. I’d like these to be the same size, side by side. I’m am having a really hard time figuring out how to create the subplots though. …

Total answers: 1

Setting xtick labels in of an sns.heatmap subplot

Setting xtick labels in of an sns.heatmap subplot Question: I am trying to put 3 subplots of sns.heatmap with custom xticklabels and yticklabels. You can see that the labels I enter overlaps with some default labels. How to avoid this? glue = sns.load_dataset("glue").pivot("Model", "Task", "Score") xlabels=[‘a’,’b’,’c’,’d’,’e’,’f’,’g’,’h’] ylabels=[‘AA’,’BB’,’CC’,’DD’,’EE’,’FF’,’GG’,’HH’] fig, (ax1,ax2,ax3) = plt.subplots(nrows=1, ncols=3,figsize=(24,8)) ax1 = fig.add_subplot(1,3,1) …

Total answers: 1

Generate a subplot with ylim in df.boxplot()

Generate a subplot with ylim in df.boxplot() Question: I have the following code: df.boxplot(column = [‘rate’], by = ‘age’, figsize=(9,7)) However, this boxplot has an outlier that shows really small the boxes. I need to code the following: #1st Subplot df.boxplot(column = [‘rate’], by = ‘age’, figsize=(9,7)) #2nd Subplot df.boxplot(column = [‘rate’], by = ‘age’, …

Total answers: 1

Setting xlabels for each suplot in a seaborn Pairgrid object plotted using matplotlib

Setting xlabels for each suplot in a seaborn Pairgrid object plotted using matplotlib Question: I am trying to set individual xlabels for each subplot in a seaborn parigrid object, but the plot wont update and just shows me the xlables for the bottom most plot only. g = sns.PairGrid(dat,x_vars = inputs, y_vars = outputs, hue …

Total answers: 1