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

Generate no figure file (for use in the notebook) #10

Closed
leouieda opened this issue Jul 2, 2017 · 1 comment
Closed

Generate no figure file (for use in the notebook) #10

leouieda opened this issue Jul 2, 2017 · 1 comment

Comments

@leouieda
Copy link
Member

leouieda commented Jul 2, 2017

When using the Jupyter notebook, one doesn't necessarily want a figure file on disk in the end. The embedded PNG in the notebook is enough.

There needs to be an option for begin, end, figure to say that I don't want any outputs when calling end.

@leouieda
Copy link
Member Author

leouieda commented Jul 2, 2017

Right now, gmt figure requires a prefix argument and gmt end always pulls the .ps from the temp folder because it's assumed that you want a figure file in the end. But when working in the notebook we might not want a figure file. Most times, the user just wants to see the figure inline. My plans for that are to make a hidden call to gmt.psconvert inside gmt.end() to get a PNG image in memory and insert that into the notebook. This wouldn't generate any files in the current directory.

A few needed for this to work:

  • Some way to tell "end" that no figure should be made.
  • Allow "figure" to receive no arguments.

Not saving a figure should probably be the default behavior in Python (like matplotlib).
We could add an argument to gmt.figure and/or gmt.begin (maybe save=True) to indicate that we want a saved figure in the end.
Another option would be to only save when explicitly provided the figure format.
This doesn't need to happen on the C API side. It can be done in Python (if no format is given, then indicate to the C API that "end" shouldn't create the files).

@leouieda leouieda closed this as completed Jul 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant