-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
hide tick labels on boxplots in scatterplotmatrix #623
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
Conversation
-provided diag options in @theengineear Let me know if this looks good to you. 🐔 No rush. |
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.
Non-blocking comments, but a little cleanup, documentation would be nice :) Also, is there an open issue that this closes?
# 'domain': [0.0, 0.425], 'title': 'Fruit'}, | ||
# 'yaxis4': {'anchor': 'x4', | ||
# 'domain': [0.0, 0.425]}} | ||
# } |
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 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.
Whoopsi, forgot to erase
@@ -3881,6 +3881,9 @@ def _scatterplot(dataframe, headers, diag, size, | |||
title=title, | |||
showlegend=True | |||
) | |||
|
|||
fig = FigureFactory._hide_tick_labels_from_box_subplots(fig) |
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.
Can you rename this to something more generic now? I.e., the box
in there? Just looks funny to me.
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.
nvm. this is new! i'll comment down there :)
@@ -4559,6 +4563,23 @@ def _scatterplot_theme(dataframe, headers, diag, size, height, | |||
return fig | |||
|
|||
@staticmethod | |||
def _hide_tick_labels_from_box_subplots(fig): | |||
""" | |||
Hides tick labels for box plots in scatterplotmatrix subplots. |
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.
👌
for j, plot_data in enumerate(fig['data']): | ||
if plot_data['type'] == 'box': | ||
boxplot_xaxes.append( | ||
'xaxis{}'.format(plot_data['xaxis'][-1]) |
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'm not 100% convinced this is correct. Doesn't x1
map to xaxis
in layout? ORRRRR, is it because in plotly.py we don't use xaxis
, instead using xaxis1
? Mind throwing a code comment in here?
Hides tick labels for box plots in scatterplotmatrix subplots. | ||
""" | ||
boxplot_xaxes = [] | ||
for j, plot_data in enumerate(fig['data']): |
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.
Why the j
and enumerate
?
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.
Also, we usually call plot_data
--> trace
.
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 dunno what other people do, but my 👍 indicate that I agree with your comment and have already made that change to my local files (before pushing)
Do you recommend something else or is this all good? Just for clarity and global consistency.
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.
The 👍 seems to be popular/common.
for xaxis in boxplot_xaxes: | ||
fig['layout'][xaxis]['showticklabels'] = False | ||
|
||
return fig |
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.
Personal preference, but I'm not a huge fan of the chaining pattern. You're mutating fig
in this function and it makes it super clear that that's your intention if you don't return anything.
I.e., don't return fig
to make it clear to callers that this function mutates the fig
you give it.
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.
This makes a lot of sense. I fig
ured that you'd need to assign back to fig
cause was pointing to another fig and not mutating, but I suppose that's what it's doing.
@@ -4806,7 +4827,8 @@ def create_scatterplotmatrix(df, index=None, endpts=None, diag='scatter', | |||
that defines intervals on the real line. They are used to group | |||
the entries in an index of numbers into their corresponding | |||
interval and therefore can be treated as categorical data | |||
:param (str) diag: sets the chart type for the main diagonal plots | |||
:param (str) diag: sets the chart type for the main diagonal plots. | |||
The options are 'scatter', 'histogram' and 'box'. |
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.
👌
Don't think so, but a user complained about it. Plus, I had been trying to figure this out a while ago. Is it better to have an issue to link to to make us look productive? 😛 |
Well, it's sorta nice to have a sense of a queue that we're getting work done in. No huge deal though. |
No description provided.