Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Legends cut off in Jupyter Notebooks when plotting with %matplotlib notebook command #9163

Closed
Milestone
@mtd91429

Description

@mtd91429

Bug report

When using matplotlib in a Jupyter Notebook with the magic%matplotlib notebook, legends placed outside of the axis are cut off.

Code for reproduction

importmatplotlib.pyplotasplt# probably unnecessary/overkill, but reset all parameters to defaultplt.rcParams.update(plt.rcParamsDefault)%matplotlibnotebookfig,ax=plt.subplots(ncols=1,nrows=1)ax.plot(range(10),label="Plot 1")ax.plot(range(10,0,-1),label="Plot 2")ax.legend(loc='center right',bbox_to_anchor=(1.20,0.5))

Actual outcome

image

Expected outcome

The legend would be fully displayed as in the following example. This plot obtained by switching to%matplotlib inline
image

Matplotlib version

  • Operating System: Windows 7, x64
  • Matplotlib Version: 2.0.2
  • Python Version: 3.6.2
  • Jupyter Server: 5.0.0
  • Other Libraries:

Matplotlib and python were installed using Anaconda

Additional Information
This seems similar to#2530

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp