-
-
Notifications
You must be signed in to change notification settings - Fork 313
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
add backend and update_state kwargs to show #4558
base: master
Are you sure you want to change the base?
Conversation
do any other also, i noticed that |
Thank you, seems reasonable!
Yeah why not :) |
d405f8a
to
d610883
Compare
all i can think to test is for the presence of a ideally i'd like to test that specifying a different backend works, but that would require putting the test in one of the backend repos and adding a dependency to one of the other backends. you don't want to go that far, do you? |
d610883
to
8ac3f36
Compare
ready for review |
the failed test on WGLMakie for julia 1.6 is a memory leak. is that related to this PR? |
just added another kwarg to make reseting the axis limits optional when [EDIT: let me know if you'd prefer this to be in a separate PR] |
@@ -244,17 +244,16 @@ function Base.show(io::IO, m::MIME"text/markdown", fig::FigureLike) | |||
throw(MethodError(show, io, m, fig)) | |||
end | |||
|
|||
function Base.show(io::IO, m::MIME, figlike::FigureLike) | |||
function Base.show(io::IO, m::MIME, figlike::FigureLike; backend = current_backend(), update_state=true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think just update
would be better since that's what we use in display()
as discussed
show
is the way to "save" a figure to an IOBuffer. but if the figure was made with say WGLMakie and you want to save as say PDF then it's a bit cumbersome because you have toCairoMakie.activate!
and thenWGLMakie.activate!
aftershow
ing. this PR make it more concise by adding abackend
kwarg toshow
, just likesave
has one already. so one can simplyshow(...; backend=CairoMakie)
instead of activating and deactivating it.Type of change
Delete options that do not apply:
Checklist