+L i :ddlmZddlmZdZdZdZdZ dZ y)Nctj\}}|jddgddgd|jddgddgd|jt j |}|j jdk(sJt|jdk(sJ|jdjdk(sJ|jdjdk(sJy) zGTest that when matplotlib legend is present, Plotly uses native legend.rLine 1labelzLine 2TN) pltsubplotsplotlegendtls mpl_to_plotlylayout showlegendlendatanamefigax plotly_figs m/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/plotly/matplotlylib/tests/test_renderer.py9test_native_legend_enabled_when_matplotlib_legend_presentrsllnGCGGQFQF(G+GGQFQF(G+IIK""3'J    ' '4 // / z 1 $$ $ ??1  " "h .. . ??1  " "h .. .cttj\}}|jddgddgdd|jt j |}|j jdk(sJt|j jdk(sJt|j jdk(sJy)zFTest that fake legend shapes are not created when using native legend.rrzo-zData with markersrTN) r r r r r rrrrshapes annotationsrs r-test_no_fake_legend_shapes_with_native_legendrsllnGCGGQFQFD(;G<IIK""3'J    ' '4 // / z  '' (A -- - z  ,, - 22 2rctj\}}|jddgddgdtj|}t |j dr|j jdk7sJyy)zETest that legend is not enabled when no matplotlib legend is present.rrrrrTN)r r r r rhasattrrrrs r.test_legend_disabled_when_no_matplotlib_legendr!%ssllnGCGGQFQF(G+""3'J J%%| 4    ' '4 / 0 / 5rc2tj\}}|jddgddgd|j}|j dt j |}t|jdr|jjdk7sJyy) zITest that legend is not enabled when no matplotlib legend is not visible.rrrrFrTN) r r r r set_visibler rr rr)rrr rs r7test_legend_disabled_when_matplotlib_legend_not_visibler$4sllnGCGGQFQF(G+ YY[F u""3'J J%%| 4    ' '4 / 0 / 5rctj\}}|jgdgddd|jgdgddd|jgdgd d d |jt j |}|j jd k(sJt|jd k(sJ|jdjdk(sJ|jdjdk(sJ|jdjd k(sJ|jdjdk(sJ|jdjdk(sJ|jdjdk(sJy)zATest native legend works with multiple traces of different types.)rrr)rrr-Liner)rrroMarkers)?r*r*zs-z Line+MarkersTrrrlinesmarkersz lines+markersN) r r r r r rrrrrrmoders r"test_multiple_traces_native_legendr/DsEllnGCGGIy#VG4GGIy#YG7GGINGCIIK""3'J    ' '4 // / z 1 $$ $ ??1  " "f ,, , ??1  " "i // / ??1  " "n 44 4 ??1  " "g -- - ??1  " "i // / ??1  " "o 55 5r) matplotlib.pyplotpyplotr plotly.toolstoolsr rrr!r$r/rrr5s$/" 3   6r