Skip to content

Hide fully transparent latex text in PS output #21470

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
Oct 27, 2021

Conversation

yschroeder
Copy link
Contributor

@yschroeder yschroeder commented Oct 27, 2021

PR Summary

This PR closes #21466. It is a follow-up fix for #10166.

The PS backend initially rendered transparent text, which was not visible in other backends (e.g. PDF). #101166 fixed this for regular text but missed fixing this when using latex to render text. This PR fixes the problem for latex.

In #21466 @anntzer proposed to add a @pytest.mark.parametrize() decorator to test_transparency(). However, I think duplicating the test is the better approach here, as we also need the @needs_usetex decorator. this would result in the test not being run anymore when latex is missing which would be a step back.

However, if you think it is fine that the test is only run when latex is installed, we can change to @pytest.mark.parametrize(). I tried this already but had the additional problem that the test would be green regardless of the fix being applied (this is either me being stupid or @image_comparison() not working with additional decorators).

PR Checklist

  • Has pytest style unit tests (and pytest passes).
  • Is Flake 8 compliant (run flake8 on changed files to check).
  • New features are documented, with examples if plot related.
  • Documentation is sphinx and numpydoc compliant (the docs should build without error).
  • Conforms to Matplotlib style conventions (install flake8-docstrings and run flake8 --docstring-convention=all).
  • New features have an entry in doc/users/next_whats_new/ (follow instructions in README.rst there).
  • API changes documented in doc/api/next_api_changes/ (follow instructions in README.rst there).

This problem was fixed before for non-latex text. However, when using
latex to render transparent text, it would still show up in PS output.
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for opening your first PR into Matplotlib!

If you have not heard from us in a while, please feel free to ping @matplotlib/developers or anyone who has commented on the PR. Most of our reviewers are volunteers and sometimes things fall through the cracks.

You can also join us on gitter for real-time discussion.

For details on testing, writing docs, and our review process, please see the developer guide

We strive to be a welcoming and open project. Please follow our Code of Conduct.

Copy link
Contributor

@anntzer anntzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch re: needs_usetex. Approving modulo CI.

@jklymak jklymak added this to the v3.5.0 milestone Oct 27, 2021
@jklymak
Copy link
Member

jklymak commented Oct 27, 2021

I don't see any reason to not back port this.

@jklymak jklymak merged commit 1364994 into matplotlib:main Oct 27, 2021
@jklymak
Copy link
Member

jklymak commented Oct 27, 2021

Thanks @yschroeder !

meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Oct 27, 2021
QuLogic added a commit that referenced this pull request Oct 27, 2021
…470-on-v3.5.x

Backport PR #21470 on branch v3.5.x (Hide fully transparent latex text in PS output)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: EPS export shows hidden tick labels when using tex for text rendering
3 participants