Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save the image to a specified location #5030

Open
Z-joe7 opened this issue Oct 24, 2024 · 4 comments
Open

Save the image to a specified location #5030

Z-joe7 opened this issue Oct 24, 2024 · 4 comments
Labels

Comments

@Z-joe7
Copy link

Z-joe7 commented Oct 24, 2024

I‘m using the yt project to visual my hdf5 data, this tool is absolutely handy! But I don't know how to save the pic to a specified location, can I ask for your guidance?

    for item in files[1:] 

            path = str(item)
            ds = yt.load(path)
            p = yt.ProjectionPlot(ds, "z", "density")
            p.save()      #I want to specify a location in here
Copy link

welcome bot commented Oct 24, 2024

Hi, and welcome to yt! Thanks for opening your first issue. We have an issue template that helps us to gather relevant information to help diagnosing and fixing the issue.

@neutrinoceros
Copy link
Member

Hi ! You should be able to specify a either a complete path as the first argument to save or just a directory, in which case the filename will be automatically generated. Does this answer your question ?

@Z-joe7
Copy link
Author

Z-joe7 commented Oct 24, 2024

Thank fou your reply! But maybe I don't describe the question clearly. I want to save all my pics to a pecified location because now they just save at the work directory, how should transmit the parameter?

@neutrinoceros
Copy link
Member

p.save("any/path/you/like")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants