Skip to content

Commit 21ac680

Browse files
committed
andrews comments
1 parent fdb1755 commit 21ac680

File tree

2 files changed

+10
-81
lines changed

2 files changed

+10
-81
lines changed

plotly/tests/test_optional/test_figure_factory.py

Lines changed: 0 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1145,76 +1145,6 @@ def test_scatter_plot_matrix(self):
11451145
title='Scatterplot Matrix'
11461146
)
11471147

1148-
# exp_scatter_plot_matrix = {
1149-
# 'data': [{'marker': {'size': 13},
1150-
# 'mode': 'markers',
1151-
# 'showlegend': False,
1152-
# 'type': 'scatter',
1153-
# 'x': [2, 6, -15, 5, -2, 0],
1154-
# 'xaxis': 'x1',
1155-
# 'y': [2, 6, -15, 5, -2, 0],
1156-
# 'yaxis': 'y1'},
1157-
# {'marker': {'size': 13},
1158-
# 'mode': 'markers',
1159-
# 'showlegend': False,
1160-
# 'type': 'scatter',
1161-
# 'x': ['Apple',
1162-
# 'Pear',
1163-
# 'Apple',
1164-
# 'Pear',
1165-
# 'Apple',
1166-
# 'Apple'],
1167-
# 'xaxis': 'x2',
1168-
# 'y': [2, 6, -15, 5, -2, 0],
1169-
# 'yaxis': 'y2'},
1170-
# {'marker': {'size': 13},
1171-
# 'mode': 'markers',
1172-
# 'showlegend': False,
1173-
# 'type': 'scatter',
1174-
# 'x': [2, 6, -15, 5, -2, 0],
1175-
# 'xaxis': 'x3',
1176-
# 'y': ['Apple',
1177-
# 'Pear',
1178-
# 'Apple',
1179-
# 'Pear',
1180-
# 'Apple',
1181-
# 'Apple'],
1182-
# 'yaxis': 'y3'},
1183-
# {'marker': {'size': 13},
1184-
# 'mode': 'markers',
1185-
# 'showlegend': False,
1186-
# 'type': 'scatter',
1187-
# 'x': ['Apple',
1188-
# 'Pear',
1189-
# 'Apple',
1190-
# 'Pear',
1191-
# 'Apple',
1192-
# 'Apple'],
1193-
# 'xaxis': 'x4',
1194-
# 'y': ['Apple', 'Pear', 'Apple', 'Pear', 'Apple', 'Apple'],
1195-
# 'yaxis': 'y4'}],
1196-
# 'layout': {'height': 1000,
1197-
# 'showlegend': True,
1198-
# 'title': 'Scatterplot Matrix',
1199-
# 'width': 1000,
1200-
# 'xaxis1': {'anchor': 'y1',
1201-
# 'domain': [0.0, 0.45]},
1202-
# 'xaxis2': {'anchor': 'y2',
1203-
# 'domain': [0.55, 1.0]},
1204-
# 'xaxis3': {'anchor': 'y3',
1205-
# 'domain': [0.0, 0.45], 'title': 'Numbers'},
1206-
# 'xaxis4': {'anchor': 'y4',
1207-
# 'domain': [0.55, 1.0], 'title': 'Fruit'},
1208-
# 'yaxis1': {'anchor': 'x1',
1209-
# 'domain': [0.575, 1.0], 'title': 'Numbers'},
1210-
# 'yaxis2': {'anchor': 'x2',
1211-
# 'domain': [0.575, 1.0]},
1212-
# 'yaxis3': {'anchor': 'x3',
1213-
# 'domain': [0.0, 0.425], 'title': 'Fruit'},
1214-
# 'yaxis4': {'anchor': 'x4',
1215-
# 'domain': [0.0, 0.425]}}
1216-
# }
1217-
12181148
exp_scatter_plot_matrix = {
12191149
'data': [{'name': None,
12201150
'showlegend': False,

plotly/tools.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3882,7 +3882,7 @@ def _scatterplot(dataframe, headers, diag, size,
38823882
showlegend=True
38833883
)
38843884

3885-
fig = FigureFactory._hide_tick_labels_from_box_subplots(fig)
3885+
FigureFactory._hide_tick_labels_from_box_subplots(fig)
38863886

38873887
return fig
38883888

@@ -4031,7 +4031,7 @@ def _scatterplot_dict(dataframe, headers, diag, size,
40314031
yaxis_key = 'yaxis{}'.format(1 + (dim * j))
40324032
fig['layout'][yaxis_key].update(title=headers[j])
40334033

4034-
fig = FigureFactory._hide_tick_labels_from_box_subplots(fig)
4034+
FigureFactory._hide_tick_labels_from_box_subplots(fig)
40354035

40364036
if diag == 'histogram':
40374037
fig['layout'].update(
@@ -4216,7 +4216,7 @@ def _scatterplot_theme(dataframe, headers, diag, size, height,
42164216
yaxis_key = 'yaxis{}'.format(1 + (dim * j))
42174217
fig['layout'][yaxis_key].update(title=headers[j])
42184218

4219-
fig = FigureFactory._hide_tick_labels_from_box_subplots(fig)
4219+
FigureFactory._hide_tick_labels_from_box_subplots(fig)
42204220

42214221
if diag == 'histogram':
42224222
fig['layout'].update(
@@ -4391,7 +4391,7 @@ def _scatterplot_theme(dataframe, headers, diag, size, height,
43914391
yaxis_key = 'yaxis{}'.format(1 + (dim * j))
43924392
fig['layout'][yaxis_key].update(title=headers[j])
43934393

4394-
fig = FigureFactory._hide_tick_labels_from_box_subplots(fig)
4394+
FigureFactory._hide_tick_labels_from_box_subplots(fig)
43954395

43964396
if diag == 'histogram':
43974397
fig['layout'].update(
@@ -4538,7 +4538,7 @@ def _scatterplot_theme(dataframe, headers, diag, size, height,
45384538
yaxis_key = 'yaxis{}'.format(1 + (dim * j))
45394539
fig['layout'][yaxis_key].update(title=headers[j])
45404540

4541-
fig = FigureFactory._hide_tick_labels_from_box_subplots(fig)
4541+
FigureFactory._hide_tick_labels_from_box_subplots(fig)
45424542

45434543
if diag == 'histogram':
45444544
fig['layout'].update(
@@ -4568,17 +4568,16 @@ def _hide_tick_labels_from_box_subplots(fig):
45684568
Hides tick labels for box plots in scatterplotmatrix subplots.
45694569
"""
45704570
boxplot_xaxes = []
4571-
for j, plot_data in enumerate(fig['data']):
4572-
if plot_data['type'] == 'box':
4571+
for trace in fig['data']:
4572+
if trace['type'] == 'box':
4573+
# stores the xaxes which correspond to boxplot subplots
4574+
# since we use xaxis1, xaxis2, etc, in plotly.py
45734575
boxplot_xaxes.append(
4574-
'xaxis{}'.format(plot_data['xaxis'][-1])
4576+
'xaxis{}'.format(trace['xaxis'][-1])
45754577
)
4576-
45774578
for xaxis in boxplot_xaxes:
45784579
fig['layout'][xaxis]['showticklabels'] = False
45794580

4580-
return fig
4581-
45824581
@staticmethod
45834582
def _validate_index(index_vals):
45844583
"""

0 commit comments

Comments
 (0)