-
Notifications
You must be signed in to change notification settings - Fork 47
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
Corr plot module #220
Corr plot module #220
Conversation
This class is intended to build correlation matrix plots. | ||
""" | ||
|
||
def __init__(self, data, show_legend=None, flip=None): |
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.
Lets's have: flip=True
self._data = data | ||
self._show_legend = show_legend | ||
self._format = '.2f' | ||
self._reverse_y = flip if flip is not None else 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.
True if flip else False
would work.
if color: | ||
other_args['color'] = color | ||
else: | ||
other_args['color'] = self._text_color |
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.
What happens with text's color if user adds 'tiles' after 'labels'?
|
||
return res | ||
|
||
def _set_diverging_palette(self, palette): |
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.
Let's rename to _set_brewer_palette.
|
||
def _set_diverging_palette(self, palette): | ||
self._color_scale = scale_color_brewer(name='Correlation', | ||
type='div', |
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.
Remove type='div'
|
||
layers = [] | ||
|
||
if self._tiles_layer: |
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.
Let's use API:
plot = ggplot(self._data)
if self._tiles_layer:
plot += self._tiles_layer
...
self._text_color = None | ||
self._tiles_layer = None | ||
self._points_layer = None | ||
self._labels_layer = None | ||
self._color_scale = scale_color_gradient2(name='Correlation', |
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.
'Correlation' takes too much space on the plot, let's call it 'Corr'.
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.
Done
9149e2f
to
ebdac2d
Compare
b14c4d0
to
0116ad0
Compare
No description provided.