0

To see the wrong Bar plot click here

I want to plot a bar graph with x_axis is price and y_axis is inter-price time.But the price is a large amount of data, so in this plot, theres too much bars and labels, so theyre overlapping with each other and cannot read.I hope to decrease the labels but keep the bars. How can I solve this problem? the data is like:

0.05$ 1000

0.06$ 1200

0.04$ 1040

and the code is

# plot bar graph
plt.subplot(222)
ax2 = plt.gca()  # get axis
plt.xlabel('Price / $')# set label
plt.ylabel('Interval / Second')
ax2.yaxis.get_major_formatter().set_powerlimits((0,1)) # set number

and use Seaborn to plot sns.barplot(df_sort['Price'],df_sort['Interval'],errwidth=1.0,palette="Blues_d",edgecolor='white')#plot

Leeafay
  • 39
  • 8
  • **How** would you like the plot to look like instead? Note that if you plot 100 bars and each has a label, labels will of course overlap. Would you like to plot less bars, or leave out every second label or make the figure one meter wide? – ImportanceOfBeingErnest Jan 17 '18 at 09:41
  • Possible duplicate of [How to prevent overlapping x-axis labels in sns.countplot](https://stackoverflow.com/questions/42528921/how-to-prevent-overlapping-x-axis-labels-in-sns-countplot) – ImportanceOfBeingErnest Jan 17 '18 at 10:31
  • @I want to have less bars.Such as just 5 or 6. – Leeafay Jan 18 '18 at 16:35
  • @ImportanceOfBeingErnest You said quit right! The reason of overlapping is I have too much bars.And I don`t know how to only decrease the labels but remain the bars. – Leeafay Jan 18 '18 at 16:36
  • @ImportanceOfBeingErnest Thank you very much for your help! I have solve this problem by decrease the label!!!!>_ – Leeafay Jan 18 '18 at 16:47

0 Answers0