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

Equivalent to matplotlib's savefig ? #129

Open
andb0t opened this issue Feb 18, 2018 · 3 comments
Open

Equivalent to matplotlib's savefig ? #129

andb0t opened this issue Feb 18, 2018 · 3 comments

Comments

@andb0t
Copy link

andb0t commented Feb 18, 2018

Hi,
I browsed the repo and googled but couldn't find if there is an option equivalent to matplotlib's savefig. I need my code to run without X server and produce the plots as pdf or png. Does this option exist?

@LelandBarnard
Copy link

I am also looking for this feature. Does anyone have any suggestions?

@andb0t
Copy link
Author

andb0t commented Jul 25, 2018

FYI: I solved it by running an Xserver (in my case Xming for Windows Subsystem for Linux (WSL))

You can find my implementation here: click

@oshikiri
Copy link
Collaborator

oshikiri commented Aug 3, 2018

FYI: As an experiment, I added the following code to WindowRenderer#show(), but it output a white blank png.

val image = window.webView.snapshot(new SnapshotParameters(), null)
val bufferedImage = SwingFXUtils.fromFXImage(image, null)
ImageIO.write(bufferedImage, "png", new File("output.png"))

javafx may not support such a use case?
cf. https://stackoverflow.com/a/23444861/9625883

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

No branches or pull requests

3 participants