Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
ENH: add a gradient map to background gradient #39930
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
ENH: add a gradient map to background gradient #39930
Changes from 8 commits
ce4cb00
d12d0af
e0cf6f0
ea7b5ee
d0a3b9e
ddaa18a
72c0825
c6adc82
898bd8c
aa3a83e
3bd0c51
56e80ef
af852d0
3c06bd3
a696353
233e4c3
357c1bb
59d5a57
ffa19c7
1f44a5b
233135a
0245960
64136e9
73a5cb1
a92e42d
0ec339e
b6c2fda
bd025b8
277e2d7
7141e4c
439a853
88117eb
380d2d3
b7b7179
2656c75
41f0e8c
02d13f4
8db2b50
3612431
e6c3aaa
9d247e9
aad0fa9
968e99f
130d735
946d11f
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
hmm, shouldn't this just be a DataFrame that is aligned? why go to all of this complication (and its fragile)?
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.
In all cases the
gmap
has to match the data shapes
if it doesn't it would just raise downstream error. This way, imo the code is simple and concise and provides both flexibility of input and helpful user error feedback.in the case
axis
in [0,1] thens
, the data, is guaranteed a 1d-series, and you can supply, asgmap
either 1d or 2d inputs provided the second dim has length 1 so it can be reshaped:in the case
axis
is None ands
is a DataFrame with 2 cols or more then you need a 2d input (or in edge-case a ravelled 1d input):In the case
axis
is None and the the data is a 1-col dataframe any of the 1d cases will again work, e.gThere 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.
you need to for sure align if a dataframe is passed.
ok on 2D. why is accepting 1D ok ? this is just too flexible. I dont' see any advantage to this.
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.
Ok how's this: I've split the 1d and 2d cases still compare shape at end with error if they don't match.
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 you are missing my point. what does a 2D gradient map mean / do? I don't see any tests that actually use this nor what its supposed to do.
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.
there are tests now for 2D arrays and DataFrames, for minimalist correct functionality, but not to demonstrate purpose.
the purpose of a 2D map is generally improved visualisation of 2D tabular data. If you just shade the background of a dataframe according to data that you can already read in the cell it just looks nice but doesn't convey information. But if you can, optionally, shade a background based on an alternate 2D map (
axis=None
) then you are providing a visual cross section of information analysis, like my examples given below, and say the performance grid here You can't achieve this with only the 1D (axis=0,1
) functionality.You could technically do heat maps currently but you would have to hide the cell data with CSS. This PR offers an easier solution for something like Look at 9. Heat Map (no text in cell). And you can only shade string cells with a provided quantitative map: something like doing this