Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7a2dffa

Browse files
committed
Adding stashed changes
1 parent e25d392 commit 7a2dffa

File tree

1 file changed

+30
-80
lines changed

1 file changed

+30
-80
lines changed

plotly/tests/test_optional/test_figure_factory.py

Lines changed: 30 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -693,58 +693,6 @@ def test_valid_endpts(self):
693693
df, use_theme=True, index='a',
694694
palette='Blues', endpts=[2, 1])
695695

696-
"""
697-
def test_scatter_plot_matrix_kwargs(self):
698-
699-
# check if test scatter plot matrix matches with
700-
# the expected output
701-
df = pd.DataFrame([[2, 'Apple'], [6, 'Pear'],
702-
[-15, 'Apple'], [5, 'Pear'],
703-
[-2, 'Apple'], [0, 'Apple']],
704-
columns=['Numbers', 'Fruit'])
705-
706-
test_scatter_plot_matrix = tls.FigureFactory.create_scatterplotmatrix(
707-
df, index='Fruit', endpts=[-10, -1], diag='histogram',
708-
height=1000, width=1000, size=13, title='Scatterplot Matrix',
709-
use_theme=True, palette='YlOrRd', marker=dict(symbol=136)
710-
)
711-
712-
exp_scatter_plot_matrix = {
713-
'data': [{'marker': {'color': 'rgb(128.0, 0.0, 38.0)'},
714-
'showlegend': False,
715-
'type': 'histogram',
716-
'x': [6, 5],
717-
'xaxis': 'x1',
718-
'yaxis': 'y1'},
719-
{'marker': {'color': 'rgb(255.0, 255.0, 204.0)'},
720-
'showlegend': False,
721-
'type': 'histogram',
722-
'x': [2, -15, -2, 0],
723-
'xaxis': 'x1',
724-
'yaxis': 'y1'}],
725-
'layout': {'barmode': 'stack',
726-
'height': 1000,
727-
'showlegend': True,
728-
'title': 'Scatterplot Matrix',
729-
'width': 1000,
730-
'xaxis1': {'anchor': 'y1',
731-
'domain': [0.0, 1.0],
732-
'title': 'Numbers'},
733-
'yaxis1': {'anchor': 'x1',
734-
'domain': [0.0, 1.0],
735-
'title': 'Numbers'}}
736-
}
737-
738-
self.assert_dict_equal(test_scatter_plot_matrix['data'][0],
739-
exp_scatter_plot_matrix['data'][0])
740-
741-
self.assert_dict_equal(test_scatter_plot_matrix['data'][1],
742-
exp_scatter_plot_matrix['data'][1])
743-
744-
self.assert_dict_equal(test_scatter_plot_matrix['layout'],
745-
exp_scatter_plot_matrix['layout'])
746-
"""
747-
748696
def test_scatter_plot_matrix(self):
749697

750698
# check if test scatter plot matrix without index or theme matches
@@ -838,44 +786,46 @@ def test_scatter_plot_matrix(self):
838786
self.assert_dict_equal(test_scatter_plot_matrix['layout'],
839787
exp_scatter_plot_matrix['layout'])
840788

841-
def test_scatter_plot_matrix_with_index(self):
789+
def test_scatter_plot_matrix_kwargs(self):
842790

843-
# check if test scatter plot matrix with index matches
791+
# check if test scatter plot matrix matches with
844792
# the expected output
845793
df = pd.DataFrame([[2, 'Apple'], [6, 'Pear'],
846794
[-15, 'Apple'], [5, 'Pear'],
847795
[-2, 'Apple'], [0, 'Apple']],
848796
columns=['Numbers', 'Fruit'])
849797

850798
test_scatter_plot_matrix = tls.FigureFactory.create_scatterplotmatrix(
851-
df, diag='scatter', index='Fruit', height=1000, width=1000,
852-
size=13, title='Scatterplot Matrix', use_theme=False
799+
df, index='Fruit', endpts=[-10, -1], diag='histogram',
800+
height=1000, width=1000, size=13, title='Scatterplot Matrix',
801+
use_theme=True, palette='YlOrRd', marker=dict(symbol=136)
853802
)
854803

855-
exp_scatter_plot_matrix = {'data': [{'marker': {'color': 'rgb(31, 119, 180)', 'size': 13},
856-
'mode': 'markers',
857-
'name': 'Pear',
858-
'showlegend': False,
859-
'type': 'scatter',
860-
'x': [6, 5],
861-
'xaxis': 'x1',
862-
'y': [6, 5],
863-
'yaxis': 'y1'},
864-
{'marker': {'color': 'rgb(255, 127, 14)', 'size': 13},
865-
'mode': 'markers',
866-
'name': 'Apple',
867-
'showlegend': False,
868-
'type': 'scatter',
869-
'x': [2, -15, -2, 0],
870-
'xaxis': 'x1',
871-
'y': [2, -15, -2, 0],
872-
'yaxis': 'y1'}],
873-
'layout': {'height': 1000,
874-
'showlegend': True,
875-
'title': 'Scatterplot Matrix',
876-
'width': 1000,
877-
'xaxis1': {'anchor': 'y1', 'domain': [0.0, 1.0], 'title': 'Numbers'},
878-
'yaxis1': {'anchor': 'x1', 'domain': [0.0, 1.0], 'title': 'Numbers'}}}
804+
exp_scatter_plot_matrix = {
805+
'data': [{'marker': {'color': 'rgb(128.0, 0.0, 38.0)'},
806+
'showlegend': False,
807+
'type': 'histogram',
808+
'x': [6, 5],
809+
'xaxis': 'x1',
810+
'yaxis': 'y1'},
811+
{'marker': {'color': 'rgb(255.0, 255.0, 204.0)'},
812+
'showlegend': False,
813+
'type': 'histogram',
814+
'x': [2, -15, -2, 0],
815+
'xaxis': 'x1',
816+
'yaxis': 'y1'}],
817+
'layout': {'barmode': 'stack',
818+
'height': 1000,
819+
'showlegend': True,
820+
'title': 'Scatterplot Matrix',
821+
'width': 1000,
822+
'xaxis1': {'anchor': 'y1',
823+
'domain': [0.0, 1.0],
824+
'title': 'Numbers'},
825+
'yaxis1': {'anchor': 'x1',
826+
'domain': [0.0, 1.0],
827+
'title': 'Numbers'}}
828+
}
879829

880830
self.assert_dict_equal(test_scatter_plot_matrix['data'][0],
881831
exp_scatter_plot_matrix['data'][0])

0 commit comments

Comments
 (0)