0

Currently trying to plot a bar graph with location-names-counts vs location names:

data_location = pd.read_csv('observed.csv', usecols=['lga_name19'])
count_location = data_location['lga_name19'].value_counts()


names = data_location['lga_name19']

data_test = pd.DataFrame({'Counts': count_location,'Locations': names})
ax = data_test.plot.barh(x='Locations', y='Counts')

So are there any methods to make the graph larger to be able see each 'location' labels? Thanks

Peanut Jams
  • 374
  • 2
  • 9
  • You can look up figure parameters such as `figsize`in the [matplotlib documentation](https://matplotlib.org/api/_as_gen/matplotlib.pyplot.figure.html). But how may rows do you want to plot? That looks like an awful lot of locations. How big do you expect the figure to get? Will that be an adequate data representation? – Mr. T Nov 15 '20 at 10:10
  • Does this answer your question? [How do you change the size of figures drawn with matplotlib?](https://stackoverflow.com/questions/332289/how-do-you-change-the-size-of-figures-drawn-with-matplotlib) – Mr. T Nov 15 '20 at 20:42

1 Answers1

0

You can make the plot larger by passing desirable dimensions as kwarg figsize:

ax = data_test.plot.barh(x='Locations', y='Counts', figsize=(10,25))

Elzar
  • 16