#๐Ÿ”’ How to save plots to a specific folder within the project folder

36 messages ยท Page 1 of 1 (latest)

hexed tiger
#
        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")
shadow waspBOT
#

@hexed tiger

Python help channel opened

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.

hexed tiger
#
        plt.savefig("generate_discount_likes_count_figure_.jpg", location = "the files/data")#fix file location

#

this doesn't work

#

Would like up there

fresh burrow
hexed tiger
#

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

fresh burrow
hexed tiger
#

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

fresh burrow
hexed tiger
#

C:\Users\Eugene\PycharmProjects\34470735_python3.9\the files

#

this is the output sir.

fresh burrow
hexed tiger
#

I c ok

#

Do i just say

#

\data

#

since its in the same directory anyway

fresh burrow
hexed tiger
#

the data

#

as that explicity describes what it is on the graphs

fresh burrow
#

so yeah data\\

hexed tiger
#

๐Ÿ™‚

#

cool thanks mate

fresh burrow
#

np

hexed tiger
#

It works

#

U have saved me so much time...

#

!close

shadow waspBOT
#
Python help channel closed

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.