0

I have the code below and this is not showing the "y-label". I have already tried :

ax.ylabel = "fisdaopdfidsa"
gca.ylabel = "fdsaifds"

Anyone can help?

import seaborn as sns
import matplotlib.ticker as ticker
import matplotlib.pyplot as plt

plt.plot(violencia["ano"],violencia["taxa de homicidios"])
plt.title("Homicides Rate ")
plt.xticks(violencia["ano"])
tick_spacing=2
ax.set_ylabel("fsdfsaoi pfdasiopfidsa")
ax.set_xlabel("fsdfsaoi pfdasiopfidsa")
ax.yaxis.label.set_color('red')
ax = plt.gca()
ax.xaxis.set_major_locator(ticker.MultipleLocator(tick_spacing))
David
  • 8,113
  • 2
  • 17
  • 36
Carol
  • 9
  • 2
  • you dont use `seaborn`; might be just `plt.ylabel("text")` – David Dec 02 '19 at 10:43
  • you can try `plt.tight_layout()` at the end of your script – warped Dec 02 '19 at 10:58
  • also see https://stackoverflow.com/questions/6774086/why-is-my-xlabel-cut-off-in-my-matplotlib-plot/6776578#6776578 but use `plt.gcf().subplots_adjust(left=0.15...)` – JohanC Dec 02 '19 at 11:44

0 Answers0