Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions plotly/figure_factory/_facet_grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ def _facet_grid_color_numerical(df, x, y, facet_row, facet_col, color_name,
mode='markers',
type=trace_type,
showlegend=False,
**kwargs
**kwargs_trace
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch

)
fig.append_trace(trace, row_count + 1, col_count + 1)
if row_count == 0:
Expand Down Expand Up @@ -783,7 +783,7 @@ def create_facet_grid(df, x, y, facet_row=None, facet_col=None,
)
show_legend = False
if color_name:
if isinstance(df[color_name][0], str) or color_is_cat:
if isinstance(df[color_name].iloc[0], str) or color_is_cat:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are there other places in the code where this happens?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alishobeiri There's a elif isinstance(df[color_name][0], Number): line a little further down the code that you can change too.

Thanks for doing this! Awesome stuff.

show_legend = True
if isinstance(colormap, dict):
utils.validate_colors_dict(colormap, 'rgb')
Expand Down Expand Up @@ -812,7 +812,7 @@ def create_facet_grid(df, x, y, facet_row=None, facet_col=None,
marker_color, kwargs_trace, kwargs_marker
)

elif isinstance(df[color_name][0], Number):
elif isinstance(df[color_name].iloc[0], Number):
if isinstance(colormap, dict):
show_legend = True
utils.validate_colors_dict(colormap, 'rgb')
Expand Down