Skip to content

Commit 180e0b7

Browse files
committed
fixed scales oversight
1 parent 37d576d commit 180e0b7

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

plotly/figure_factory/_facet_grid.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,7 @@ def _facet_grid(df, x, y, facet_row, facet_col, num_of_rows,
488488
),
489489
**kwargs_trace
490490
)
491+
491492
if trace_type in ['scatter', 'scattergl']:
492493
trace['mode'] = 'markers'
493494
trace['marker'] = dict(color=marker_color, **kwargs_marker)
@@ -770,10 +771,10 @@ def create_facet_grid(df, x, y, facet_row=None, facet_col=None,
770771
"'scales' must be set to 'fixed', 'free_x', 'free_y' and 'free'."
771772
)
772773

773-
if trace_type not in VALID_TRACE_TYPES:
774-
raise exceptions.PlotlyError(
775-
"'trace_type' must be in {}".format(VALID_TRACE_TYPES)
776-
)
774+
#if trace_type not in VALID_TRACE_TYPES:
775+
# raise exceptions.PlotlyError(
776+
# "'trace_type' must be in {}".format(VALID_TRACE_TYPES)
777+
# )
777778

778779
# seperate kwargs for marker and else
779780
if 'marker' in kwargs:
@@ -988,15 +989,15 @@ def create_facet_grid(df, x, y, facet_row=None, facet_col=None,
988989
fixed_axes = ['y']
989990
elif scales == 'free_y':
990991
fixed_axes = ['x']
991-
else:
992+
elif scales == 'free':
992993
fixed_axes = []
993994

994995
# fixed ranges
995-
for x_y in ['x', 'y']:
996+
for x_y in fixed_axes:
996997
min_ranges = []
997998
max_ranges = []
998999
for trace in fig['data']:
999-
if len(trace[x_y]) > 0:
1000+
if trace[x_y] is not None and len(trace[x_y]) > 0:
10001001
min_ranges.append(min(trace[x_y]))
10011002
max_ranges.append(max(trace[x_y]))
10021003
while None in min_ranges:

0 commit comments

Comments
 (0)