Skip to content

Commit f389da2

Browse files
authored
Merge pull request plotly#783 from plotly/alishobeiri-patch-1
Index based -> ___location based indexing
2 parents 6f9f6b2 + c15be7f commit f389da2

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

plotly/figure_factory/_facet_grid.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ def _facet_grid_color_numerical(df, x, y, facet_row, facet_col, color_name,
413413
mode='markers',
414414
type=trace_type,
415415
showlegend=False,
416-
**kwargs
416+
**kwargs_trace
417417
)
418418
fig.append_trace(trace, row_count + 1, col_count + 1)
419419
if row_count == 0:
@@ -783,7 +783,7 @@ def create_facet_grid(df, x, y, facet_row=None, facet_col=None,
783783
)
784784
show_legend = False
785785
if color_name:
786-
if isinstance(df[color_name][0], str) or color_is_cat:
786+
if isinstance(df[color_name].iloc[0], str) or color_is_cat:
787787
show_legend = True
788788
if isinstance(colormap, dict):
789789
utils.validate_colors_dict(colormap, 'rgb')
@@ -812,7 +812,7 @@ def create_facet_grid(df, x, y, facet_row=None, facet_col=None,
812812
marker_color, kwargs_trace, kwargs_marker
813813
)
814814

815-
elif isinstance(df[color_name][0], Number):
815+
elif isinstance(df[color_name].iloc[0], Number):
816816
if isinstance(colormap, dict):
817817
show_legend = True
818818
utils.validate_colors_dict(colormap, 'rgb')

plotly/tests/test_optional/test_figure_factory.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1999,6 +1999,7 @@ def test_valid_color_dict(self):
19991999
data, 'a', 'b', color_name='a',
20002000
colormap=color_dict)
20012001

2002+
20022003
def test_valid_colorscale_name(self):
20032004
data = pd.DataFrame([[0, 1, 2], [3, 4, 5]],
20042005
columns=['a', 'b', 'c'])

0 commit comments

Comments
 (0)