<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>coffee_kabu</author_name>
  <author_url>https://blog.hatena.ne.jp/coffee_kabu/</author_url>
  <blog_title>Bus errorとSegmentation faultに困ったら見るブログ</blog_title>
  <blog_url>https://coffee-guhaw.hateblo.jp/</blog_url>
  <categories>
    <anon>python</anon>
    <anon>matplotlib</anon>
  </categories>
  <description>plt.plot(x, y, label=&quot;hoge&quot;) plt.legend(loc=&quot;upper right&quot;) とかやると、右上にlegendが表示される legen()でlocを指定しないとクッソ計算時間が掛かるので、位置は固定した方が良い・・・いや、マジで 枠外にlegenを置く方法もググったら色々と出てくる bbox_to_anchorとかで位置を変えてやればいいらしい■ 参考 : 備忘録：matplotlib の legend(凡例) の 位置を調整するただ、この方法でやってると画像からlegendがはみ出て全部表示されない・・・plt.figure(figsize=[15, 9…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fcoffee-guhaw.hateblo.jp%2Fentry%2F2025%2F12%2F02%2F000000&quot; title=&quot;【matplotlib, python3】legendの位置を枠外にしたい + 画像からはみ出ないようにしたい - Bus errorとSegmentation faultに困ったら見るブログ&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2025-12-02 00:00:00</published>
  <title>【matplotlib, python3】legendの位置を枠外にしたい + 画像からはみ出ないようにしたい</title>
  <type>rich</type>
  <url>https://coffee-guhaw.hateblo.jp/entry/2025/12/02/000000</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
