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

ylabel clipped with Qt5Agg backend when saving figure to png with both bbox_inches='tight' and pad_inches=0 #8473

Open
Labels
@x49

Description

@x49

Bug report

Using the Qt5Agg backend, applying both bbox_inches='tight' and pad_inches=0 together clips ylabel texts when saving to png format. The same text is not clipped when saving as pdf or with the GTK3Cairo backend.

Code for reproduction

importmatplotlibmatplotlib.use('Qt5Agg')## Causes clipping#matplotlib.use('GTK3Cairo') ## No clippingimportmatplotlib.pyplotaspltplt.ioff()plt.plot([1,2,3],[3,1,2])plt.xlabel('This text is ok. yyggjjpp [] () {}')plt.ylabel('Top is cut off, for example the fs and brackets. [] () {}')### Neither PNG nor PDF is clipped with either backendplt.savefig('test-tight.png',bbox_inches='tight')plt.savefig('test-tight.pdf',bbox_inches='tight')### PNG is clipped with Qt5Agg, not GTK3Cairo, pdf is never clippedplt.savefig('test-tight-nopad.png',bbox_inches='tight',pad_inches=0)plt.savefig('test-tight-nopad.pdf',bbox_inches='tight',pad_inches=0)

Actual outcome
When using backend 'Qt5Agg' in the png output, tall characters in the ylabel are clipped.
test-tight-nopad

Expected outcome
I expect to produce comparable output to the 'GTK3Cairo' backend, which does not clip the labels.
test-tight-nopad

Matplotlib version
All installed from Arch Linux x64 repositories.

  • Python 3.6.0
  • Matplotlib 2.0.0
  • python-pyqt5 5.8
  • python-cairocffi 0.8.0
  • python-gobject 3.22.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp