@@ -773,7 +773,7 @@ def test_simple_annotated_heatmap(self):
773773 'xref' : 'x' ,
774774 'y' : 0 ,
775775 'yref' : 'y' },
776- {'font' : {'color' : '#FFFFFF ' },
776+ {'font' : {'color' : '#000000 ' },
777777 'showarrow' : False ,
778778 'text' : '0.5' ,
779779 'x' : 2 ,
@@ -872,7 +872,7 @@ def test_annotated_heatmap_kwargs(self):
872872 'xref' : 'x' ,
873873 'y' : 'Three' ,
874874 'yref' : 'y' },
875- {'font' : {'color' : '#000000 ' },
875+ {'font' : {'color' : '#FFFFFF ' },
876876 'showarrow' : False ,
877877 'text' : 'sixth' ,
878878 'x' : 'B' ,
@@ -951,7 +951,7 @@ def test_annotated_heatmap_reversescale(self):
951951 'xref' : 'x' ,
952952 'y' : 'Three' ,
953953 'yref' : 'y' },
954- {'font' : {'color' : '#FFFFFF ' },
954+ {'font' : {'color' : '#000000 ' },
955955 'showarrow' : False ,
956956 'text' : 'sixth' ,
957957 'x' : 'B' ,
@@ -972,6 +972,91 @@ def test_annotated_heatmap_reversescale(self):
972972 self .assert_fig_equal (a ['layout' ],
973973 expected_a ['layout' ])
974974
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+
9751060
9761061class TestTable (TestCase , NumpyTestUtilsMixin ):
9771062
0 commit comments