b4kke
b4kke

Reputation: 15

Plot pre-calculated confidence intervals in seaborn pointplot

I have a dataframe containing confidence intervals of means on parameters 'likes, 'retweets', 'followers', 'pics' for 4 samples: ikke-aktant, laser, umbrella, mask. All values are a list containing the confidence intervals, e.g. [8.339078253365264, 9.023388831788864], which is the confidence interval for likes in the laser-sample. A picture of the dataframe can be seen here:https://i.sstatic.net/GOgty.jpg

I want to plot it in a seaborn pointplot, where y represents the four samples, and x is likes.

So far I have:

ax = sns.pointplot(x="likes", data=df_boot, hue='sample', join=False)

Which returns error:

TypeError: Horizontal orientation requires numeric `x` variable.

I guess this is because x is a list. Is there a way to plot my confidence intervals using pointplot?

Upvotes: 0

Views: 947

Answers (1)

DSteman
DSteman

Reputation: 1658

I think the problem is that you are using data that are already confidence intervals. Pointplot expects 'raw' data like the example dataset found here: https://github.com/mwaskom/seaborn-data/blob/master/tips.csv. So use the data that you used to calculate those confidence intervals.

Upvotes: 1

Related Questions