Help with BoxPlot Python

I am having some trouble creating the box plots for the page view time series python data analysis project. How could I make a plot that has two graphs and the two graphs have different values in the x-axis? The seaborn catplot page is not very helpful.

Take a look at subplots method in matplotlib.pyplot.

If I do the following I end up with 4 figures and I am not sure if any of them have what I am looking for:

fig,(ax1,ax2)=plt.subplots(1,2)
ax1 = sns.catplot(x="period", y="otheravg",col='type',
                data=newframe1, kind="box",
                height=4, aspect=.7)
ax2 = sns.catplot(x="period", y="otheravg",col='type',
                data=newframe2, kind="box",
                height=4, aspect=.7)

fig.axes[0].set_title('Year-wise Box Plot (Trend)')
fig.axes[1].set_title('Month-wise Box Plot (Seasonality)')
fig.axes[0].set_xlabel('Year')
fig.axes[1].set_xlabel('Month')
fig.axes[0].set_ylabel('Page Views')
fig.axes[1].set_ylabel('Page Views')

I think using the subplots function creates two plots but they are in different figures.
I am not sure how I would put them all in one figure. Also, the figures that actually have the right labels do not have the plots. The figure that gets saved also does not have the plots. I am not sure how to save one figure that has the plots.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.