Skip to content

Incorrect text clipping in presence of multiple subplots #6794

Closed

Description

@anntzer

This is a regression in 2.0b3 compared to 1.5.2 (haven't bisected more)

from matplotlib import pyplot as plt
import numpy as np

np.random.seed(1)
fig, (ax1, ax2) = plt.subplots(2)
for x, y in np.random.rand(10, 2):
    ax1.text(x, y, "foo", clip_on=True)
    ax2.text(x, y, "foo")
plt.show()

1.5.2 displays everything fine
152
2.0b3 clips away all text objects in the top axes
20b3
(so I'm marking this as 2.0 but feel free to change it)

The texts actually appear to be clipped to the "wrong" place and use the wrong zorder: you can see them appear "behind the axes" if you pan the axes as below:
panned

Activity

  1. added this to the milestone on Jul 18, 2016
  2. tacaswell commented on Jul 20, 2016

    @tacaswell
    Member

    yikes!

  3. added
    Release criticalFor bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.
    on Jul 25, 2016
  4. tacaswell commented on Jul 25, 2016

    @tacaswell
    Member

    I can confirm this and agree it needs to be bisected. Nothing obvious is jumping out at me.

  5. jenshnielsen commented on Jul 25, 2016

    @jenshnielsen
    Member

    I have bisected it and it looks like the first bad commit is the merge of #5361

    a340827407cf8397f2aea4a94fba2dbf2691e217 is the first bad commit
    commit a340827407cf8397f2aea4a94fba2dbf2691e217
    Author: Thomas A Caswell <tcaswell@gmail.com>
    Date:   Wed Nov 4 22:57:46 2015 -0500
    
        Merge pull request #5361 from mdboom/fast-text
    
        Fix #347: Faster text rendering in Agg
    
    :040000 040000 318ca4105c13e269f0258fb2fd833ba0a804c94c ab984a41574b5f97361c4b2843d6f0d166dfa2be M  doc
    :040000 040000 7b0d1be25da84428a1f661c895f6122ae5a842db 9c561f043224b6155097d0ac469ca5df689b2d5d M  src
    
  6. jenshnielsen commented on Jul 25, 2016

    @jenshnielsen
    Member

    I can also confirm that neither the cairo or pdf backend has the issue.

  7. added a commit that references this issue on Aug 29, 2016
    0315c22
  8. self-assigned this
    on Aug 29, 2016
  9. added a commit that references this issue on Aug 30, 2016
    ba83035
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Release criticalFor bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions