8000 pgf: Add clipping to text outputs by QuLogic · Pull Request #25640 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

pgf: Add clipping to text outputs #25640

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Fai 8000 led to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/matplotlib/backends/backend_pgf.py
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,7 @@ def draw_text(self, gc, x, y, s, prop, angle, ismath=False, mtext=None):
s = _escape_and_apply_props(s, prop)

_writeln(self.fh, r"\begin{pgfscope}")
self._print_pgf_clip(gc)

alpha = gc.get_alpha()
if alpha != 1.0:
Expand Down
2 changes: 2 additions & 0 deletions lib/matplotlib/tests/test_backend_pgf.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ def create_figure():
ha='right', fontsize=20)
plt.ylabel('sans-serif, blue, $\\frac{\\sqrt{x}}{y^2}$..',
family='sans-serif', color='blue')
plt.text(1, 1, 'should be clipped as default clip_box is Axes bbox',
fontsize=20, clip_on=True)

plt.xlim(0, 1)
plt.ylim(0, 1)
Expand Down
0