plotting value_counts() in seaborn barplot

In the latest seaborn, you can use the countplot function: seaborn.countplot(x=’reputation’, data=df) To do it with barplot you’d need something like this: seaborn.barplot(x=df.reputation.value_counts().index, y=df.reputation.value_counts()) You can’t pass ‘reputation’ as a column name to x while also passing the counts in y. Passing ‘reputation’ for x will use the values of df.reputation (all of them, not … Read more

How to scale Seaborn’s y-axis with a bar plot

Considering your question mentions barplot I thought I would add in a solution for that type of plot also as it differs from the factorplot in @Jules solution. import matplotlib.pyplot as plt import seaborn as sns sns.set(style=”whitegrid”) xs = [“First”, “First”, “Second”, “Second”, “Third”, “Third”] hue = [“Female”, “Male”] * 3 ys = [1988, 301, … Read more

MPAndroid Chart not displaying any labels for xAxis , what is missing?

These two lines are causing the issue : barChart.getXAxis().setAxisMinValue(10f); barChart.groupBars(10, groupSpace, barSpace); you are setting the minimum value of x axis to 10, whereas the labels will begin with index 0, So internally IndexOut of bound exception keeps occurring So, Change To: barChart.getXAxis().setAxisMinValue(0f); // Better remove setAxisMinValue(), as it deprecated barChart.groupBars(0, groupSpace, barSpace); If you … Read more

Problem in combining bar plot and line plot

Seaborn and pandas use a categorical x-axis for bar plots (internally numbered 0,1,2,…) and floating-point numbers for a line plot. Note that your x-values aren’t evenly spaced, so either the bars would have weird distances between them, or wouldn’t align with the x-values from the line plot. Here is a solution using standard matplotlib to … Read more