1

I've made a pie chart using:

df = pd.DataFrame({'columnname': ['yes', 'yes', 'no', 'maybe']})

df.columnname.value_counts().plot(kind='pie', autopct='%1.1f%%', figsize=(10,10))

Everything is how I want it to be except it has "columnname" floating vertically off to the left.

enter image description here

I've tried to find what that parameter is called in the matplotlib documentation, but can't figure out what it's called to take it out.

What is that parameter called, and how do I get rid of it?

nostradukemas
  • 317
  • 3
  • 10
  • 2
    You did not provide any data, any figure, any code. We do not even know what is "floating vertically off to the left". How do you expect people to guess what you are referring to? Since you seem to be new to Stack Overflow, you should read [How to create a Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve) – Sheldore Apr 29 '19 at 19:58
  • Possible duplicate of [pandas pie chart plot remove the label text on the wedge](https://stackoverflow.com/questions/30059862/pandas-pie-chart-plot-remove-the-label-text-on-the-wedge) – Edeki Okoh Apr 29 '19 at 20:15
  • @Sheldore I updated with data, code and an image – nostradukemas Apr 29 '19 at 20:20
  • 1
    Try: `df.columnname.value_counts().plot(kind='pie', autopct='%1.1f%%', figsize=(10,10), label='')` – Scott Boston Apr 29 '19 at 20:27
  • @ScottBoston that did it – nostradukemas Apr 29 '19 at 20:28

1 Answers1

3

Try using the label parameter in plot.

df.columnname.value_counts().plot(kind='pie', autopct='%1.1f%%', figsize=(10,10), label='')

Or, this is the y-axis label, you can hide it using

ax = df.columnname.value_counts().plot(kind='pie', autopct='%1.1f%%', figsize=(10,10))
ax.yaxis.set_visible(False)
Scott Boston
  • 147,308
  • 15
  • 139
  • 187