Skip to content

Saving/ returning plots #322

Answered by tlukkezen
EleniSmyrniou asked this question in Q&A
Discussion options

You must be logged in to vote

@EleniSmyrniou although we only return the axes in the plot_cpt and plot_bore functions, the Figure that is created under the hood is still active in matplotlib and can still be accessed by the general API

axes = plot_cpt(...)
pyplot.savefig(...)

This will allow you to save your figure until you create another Figure.

Returning just the axes allows for more flexibility in adjusting/appending to existing axes, while keeping a consistent function signature and it still allows you to access the Figure, so it seems like the best solution in our view.

For maximum control you can create your own Subplot figure and provide the axes as arguments to the plotting functions.

One thing that we could…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@EleniSmyrniou
Comment options

Answer selected by EleniSmyrniou
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants