Resolved: Saving the figures using python
In python, I have checked the figures that i have created and found out that they do not have the graph that i have created.
Here is my code.
plt.figure(figsize = (9,6))
plt.barh(y = df_use_cars["Brand"],
width = df_use_cars["Cars Listings"],
color = colors)
plt.yticks(fontsize = 13)
plt.xticks(fontsize = 13)
plt.title("Cars Listings by Brand", fontsize = 16, fontweight = "bold")
plt.xlabel("Number of Listings", fontsize = 13)
plt.savefig("Cars Listings by Brand HBar.png")
The code is correct and the outcome is correct but the saved png file is blank.
I would appreciate your help.
thanks for reaching out! Your code is indeed correct, however there is a small mistake in the video. If you swap the two last lines of your code your picture should export fine. So, have:
plt.savefig("Cars Listings by Brand HBar.png") plt.show()
I hope this helps!