0

my problem is that I could only find answers for plots sharing the same y-axis units.

My graphs are defined as follows:

#Plot1
sns.set_style("white")
sns.catplot(y="Reaction_cd_positive", x="Flux_cd_positive", 
            kind="bar",height=4, data=CDP,aspect=1.5)
#Plot2
sns.catplot(y="Reaction_cd_negative",x="Flux_cd_negative",
            kind="bar",height=4, data=CDN, aspect=1.5)

Thank you in advance!

N.Brue
  • 3
  • 2
  • What is the desired outcome? Can you describe in more than 0 words what you want to achieve? – ImportanceOfBeingErnest Nov 02 '18 at 13:54
  • The outcome should be as specified in the title. By default the graphs are plotted one under another; I want them to be right next to each other (by chance even four or more). – N.Brue Nov 02 '18 at 14:24

1 Answers1

0

Ok, let me translate this. You are using seaborn in a jupyter notebook. You want 2 barplots next to each other within the same figure, instead of two individual figures. Since catplot produces a figure by itself, there are two options.

  1. Create a single catplot with two subplots. To this end you would need to concatenate your two DataFrames into a single one, then use the col argument to split the data into the two subplots.

  2. Create a subplot grid with matplotlib first, then plot a barplot into each of the subplots. This is shown in this question.

ImportanceOfBeingErnest
  • 321,279
  • 53
  • 665
  • 712