0

I have below code in order to create a bar chart.

import matplotlib.pyplot as plt; plt.rcdefaults()
import numpy as np
import matplotlib.pyplot as plt

objects = db.source[:5]
y_pos = np.arange(len(objects))
performance = db.a[:5]

plt.bar(y_pos, performance ,width=0.5, alpha=5, linewidth=2.0, capsize=2)
plt.xticks(y_pos, objects, )
plt.ylabel('Tweet Sayısı')
plt.xlabel('Kaynak')
plt.title('Kaynağa Göre Atılan Tweet Sayıları') 
plt.show()

It works properly but plot does not show x line items seperately, items' letters are mixed each other. Do you know how can I change the size or type of the letters in x line ?

enter image description here

Arnab Biswas
  • 4,495
  • 3
  • 42
  • 60
Behzat
  • 95
  • 3
  • 12
  • 1
    Could you please try plt.xticks(y_pos, objects, rotation='vertical') and see if that satisfies your need? That will rotate the xticks vertically and make it readable. – Arnab Biswas Nov 05 '17 at 06:40
  • @ArnabBiswas thank you, that solves my problem. – Behzat Nov 05 '17 at 07:55

0 Answers0