-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
xarray support in imshow #2166
xarray support in imshow #2166
Conversation
Oh and I will fix the CI too of course (add xarray to CI deps). My hesitation here is in particular for arrays generated by datashader: since their dimensions are sometimes heterogeneous, it does not always make sense to plot them with square pixels. |
This looks great, but per semver rules belongs in 4.6 :) |
no worries :-). Anything to change ? |
Now that the patch release is out, I think this one is ready for review :-). |
if "title" not in layout_patch and args["template"].layout.margin.t is None: | ||
layout_patch["margin"] = {"t": 60} | ||
fig = go.Figure(data=trace, layout=layout) | ||
fig.update_layout(layout_patch) | ||
if img_is_xarray: |
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 actually think we can do this for np
inputs also, no, given the labels
dict? We can just default x_label
to x
etc
Co-Authored-By: Nicolas Kruchten <[email protected]>
…nto imshow-xarray
@emmanuelle LMK what you think of my changes... missing additional tests, docstring and docs but I will add them if you agree. Basically what I've done is generalized |
Thank you this looks great ! Looks like you added the tests already, 💃 ! |
I'm planning to complete the docstring and add examples in the tutorials, but I would like first to discuss whether this xarray support should rather go here in imshow or/and in a
px.matrix_heatmap
/px.heatmap
function which is yet to be written (but could be adapted from the imshow code). @nicolaskruchten interested in your thoughts here :-).