@@ -773,7 +773,7 @@ def test_simple_annotated_heatmap(self):
773
773
'xref' : 'x' ,
774
774
'y' : 0 ,
775
775
'yref' : 'y' },
776
- {'font' : {'color' : '#FFFFFF ' },
776
+ {'font' : {'color' : '#000000 ' },
777
777
'showarrow' : False ,
778
778
'text' : '0.5' ,
779
779
'x' : 2 ,
@@ -872,7 +872,7 @@ def test_annotated_heatmap_kwargs(self):
872
872
'xref' : 'x' ,
873
873
'y' : 'Three' ,
874
874
'yref' : 'y' },
875
- {'font' : {'color' : '#000000 ' },
875
+ {'font' : {'color' : '#FFFFFF ' },
876
876
'showarrow' : False ,
877
877
'text' : 'sixth' ,
878
878
'x' : 'B' ,
@@ -951,7 +951,7 @@ def test_annotated_heatmap_reversescale(self):
951
951
'xref' : 'x' ,
952
952
'y' : 'Three' ,
953
953
'yref' : 'y' },
954
- {'font' : {'color' : '#FFFFFF ' },
954
+ {'font' : {'color' : '#000000 ' },
955
955
'showarrow' : False ,
956
956
'text' : 'sixth' ,
957
957
'x' : 'B' ,
@@ -972,6 +972,91 @@ def test_annotated_heatmap_reversescale(self):
972
972
self .assert_fig_equal (a ['layout' ],
973
973
expected_a ['layout' ])
974
974
975
+ def test_bug_1300 (self ):
976
+ # https://github.com/plotly/plotly.py/issues/1300
977
+ sub_z = [
978
+ [0.1 , 0.0 , 0.0 ],
979
+ [0.0 , 1.0 , 0.1 ]]
980
+
981
+ # sub_z = sub_z.tolist()
982
+
983
+ # Standard scale direction
984
+ fig = ff .create_annotated_heatmap (
985
+ sub_z , colorscale = 'Greens' , showscale = True , reversescale = True )
986
+
987
+ expected = graph_objs .Figure ({
988
+ 'data' : [{'colorscale' : 'Greens' ,
989
+ 'reversescale' : True ,
990
+ 'showscale' : True ,
991
+ 'type' : 'heatmap' ,
992
+ 'uid' : 'baeae9f0-d650-4507-99ba-97226bb8fe6c' ,
993
+ 'z' : [[0.1 , 0. , 0. ],
994
+ [0. , 1. , 0.1 ]]}],
995
+ 'layout' : {
996
+ 'annotations' : [
997
+ {'font' : {'color' : '#000000' },
998
+ 'showarrow' : False ,
999
+ 'text' : '0.1' ,
1000
+ 'x' : 0 ,
1001
+ 'xref' : 'x' ,
1002
+ 'y' : 0 ,
1003
+ 'yref' : 'y' },
1004
+ {'font' : {'color' : '#000000' },
1005
+ 'showarrow' : False ,
1006
+ 'text' : '0.0' ,
1007
+ 'x' : 1 ,
1008
+ 'xref' : 'x' ,
1009
+ 'y' : 0 ,
1010
+ 'yref' : 'y' },
1011
+ {'font' : {'color' : '#000000' },
1012
+ 'showarrow' : False ,
1013
+ 'text' : '0.0' ,
1014
+ 'x' : 2 ,
1015
+ 'xref' : 'x' ,
1016
+ 'y' : 0 ,
1017
+ 'yref' : 'y' },
1018
+ {'font' : {'color' : '#000000' },
1019
+ 'showarrow' : False ,
1020
+ 'text' : '0.0' ,
1021
+ 'x' : 0 ,
1022
+ 'xref' : 'x' ,
1023
+ 'y' : 1 ,
1024
+ 'yref' : 'y' },
1025
+ {'font' : {'color' : '#FFFFFF' },
1026
+ 'showarrow' : False ,
1027
+ 'text' : '1.0' ,
1028
+ 'x' : 1 ,
1029
+ 'xref' : 'x' ,
1030
+ 'y' : 1 ,
1031
+ 'yref' : 'y' },
1032
+ {'font' : {'color' : '#000000' },
1033
+ 'showarrow' : False ,
1034
+ 'text' : '0.1' ,
1035
+ 'x' : 2 ,
1036
+ 'xref' : 'x' ,
1037
+ 'y' : 1 ,
1038
+ 'yref' : 'y' }
1039
+ ],
1040
+ 'xaxis' : {
1041
+ 'gridcolor' : 'rgb(0, 0, 0)' ,
1042
+ 'showticklabels' : False ,
1043
+ 'side' : 'top' ,
1044
+ 'ticks' : '' },
1045
+ 'yaxis' : {
1046
+ 'showticklabels' : False ,
1047
+ 'ticks' : '' ,
1048
+ 'ticksuffix' : ' ' }}
1049
+ })
1050
+
1051
+ # Remove uids
1052
+ for trace in fig .data :
1053
+ trace .update (uid = None )
1054
+ for trace in expected .data :
1055
+ trace .update (uid = None )
1056
+
1057
+ # Perform comparison
1058
+ self .assert_fig_equal (fig , expected )
1059
+
975
1060
976
1061
class TestTable (TestCase , NumpyTestUtilsMixin ):
977
1062
0 commit comments