-1

I created a chart using matplotlib. I am using python3.6. This is my code:

ev={}
for event in cumulatives:
    ev[event[0]]=event[1]
names = list(ev.keys())
values = list(ev.values())
count = len(names)
for i in range(count):
    plt.bar(i,values[i],tick_label=names[i])
plt.xticks(range(0,count),names)
plt.tight_layout()
plt.savefig('static/img/em_system_event_chart.png')

Here is the result.

As you can see, the x-axis is too small. How can I make the x-axis bigger?

BallpointBen
  • 9,406
  • 1
  • 32
  • 62

1 Answers1

0

From this post.

Specify the dimensions.

fig = plt.figure(figsize=(20, 2))
ax = fig.add_subplot(111)
ax.plot(x, y)

The figsize takes a tuple of width, height in inches.

NotZack
  • 518
  • 2
  • 9
  • 22