0

so I ran into a few problems while showing the graph first all the data is on each other I use strings at my x-axis and it looks like this the graph I'm generating

so I wondered if there is a way to stretch it so It won't be on each other

and my second question is if there is a way to open the graph at full screen (I maximized it manually fo the pic)

and the code I wrote to show the graph


plt.figure(figsize=(20, 10))


names_list = [ i.split("-")[0] for i in self.data_dict["data"].split(",")]

values_list = [ i.split("-")[[1]] for i in self.data_dict["data"].split(",")]

plt.subplot(132)

plt.bar(names_list[::-1], values_list[::-1])

plt.suptitle('most commen words ')

plt.show()
1
  • You can increase the figsize, try plt.figure(figsize=(40, 20)) Commented May 17, 2020 at 9:27

1 Answer 1

1

You can rotate the x-tick values using the following line:

plt.xticks(rotation=90)

That should make your labels visible. If I understand correctly, you want to increase the size of your figure ? You can do so, by increasing the figsize. For example:

plt.figure(figsize=(30, 20))
Sign up to request clarification or add additional context in comments.

1 Comment

I used the rotation and they are more visible but is there a way to make more space between them because they are still unreadable

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.