discount_below_30 = 193
b = 9820
discount_above_60 = 1696
list_slices = [discount_below_30, b, discount_above_60]
labels = ["< 30", "Discount 30 - 60", "Discount > 60"]
plt.pie(list_slices, labels=labels)
plt.title("Discounts Proprotion on Shoes")
plt.show()
plt.savefig("generate_discount_figure.jpg")
#๐ How to save plots to a specific folder within the project folder
36 messages ยท Page 1 of 1 (latest)
@hexed tiger
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
Closes after a period of inactivity, or when you send !close.
plt.savefig("generate_discount_likes_count_figure_.jpg", location = "the files/data")#fix file location
this doesn't work
Would like up there
haven't you tried plt.savefig("the files\\generate_discount_likes_count_figure_.jpg")?
No,("i am me", "iamme",)
I'll try now.
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\Eugene\\PycharmProjects\\34470735_python3.9\\the files\\the files\\generate_discount_likes_count_figure_women.jpg'
@fresh burrow
what's the current folder? are you running the python file under the files?
I think i renamed it to thefiles
but it doesnt show like that on the sidebar
???ill try
yes my files are in the files
can you print, print(os.getcwd())
C:\Users\Eugene\PycharmProjects\34470735_python3.9\the files
this is the output sir.
as I expected, you are running the script in C:\...\34470735_python3.9\the files so you won't need the "the files\\"
oh you want to save them in "data" or in "the files"?
so yeah data\\
np
This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.