legend boxをてっとり早くFigure外側に移動する
解決策
seaborn.move_legend
を利用する。
例
例えば、こんな可視化する
1 2 3 4 5 6 7 |
import numpy import seaborn as sns import pandas from matplotlib import pyplot x = numpy.random.normal(1, 10, (3, 100)) df_x = pandas.DataFrame(x) sns.lineplot(data=df_x.T) |

1 2 3 4 5 6 7 8 9 |
import numpy import seaborn as sns import pandas from matplotlib import pyplot x = numpy.random.normal(1, 10, (3, 100)) f, ax = pyplot.subplots() df_x = pandas.DataFrame(x) sns.lineplot(data=df_x.T, ax=ax) sns.move_legend(ax, loc="upper left", bbox_to_anchor=(1,1)) |

元情報
ディスカッション
コメント一覧
まだ、コメントがありません