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

Added text-as-path functionality to backend_ps.py for Issue #8480#30830

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
gigoiy wants to merge40 commits intomatplotlib:main
base:main
Choose a base branch
Loading
fromgigoiy:newfeature-for-issue-8480

Conversation

@gigoiy
Copy link

@gigoiygigoiy commentedDec 9, 2025
edited
Loading

This is a draft PR!!!

  • Confirmed that the backend doesn't path the text as opposed to being cut off via image size -> Fix functionality
  • Update docs for the new feature

PR summary

Why is this change necessary?: This change is necessary so that users have the ability to save text as vector images

What problem does it solve?: The inability to not be able to save text as vector images for the PS backend restricts matplotlib's usage in scientific journals where text being embedded as an image is a requirement

What is the reasoning for this implementation?: A user opened an issue asking for this feature because it was a requirement to submit his/her/their paper to a scientific journal

Changes Made:

  • Implemented functionality to draw text as a path tobackend_ps.py using a newrcparam calledps.pathtext
  • Updatedrcsetup.py to attach thevalidate_bool() validator tops.pathtext
  • Updatedmatplotlibrc to includeps.pathtext's default valueFalse
  • Updatedtyping.py to includeps.pathtext
  • Updatedbackend_ps.py to handle math text properly when calling the new feature and fix recursiveness
  • Updatedbackend_ps.py to use the proper method name when callingget_size()
  • Passed pre-existing pytests
  • Addedgenerate_pstext.py to help with generating the baseline image
  • Generated the baseline image
  • Addedtest_pathtext.py topytest the new feature

Supposed to close Issue#8480

PR checklist

@gigoiy
Copy link
Author

gigoiy commentedDec 10, 2025
edited
Loading

@story645 I wanted to verify something real quick: Is the PS backend using 1,000 units per EM?

Nevermind, found the UPM from the afm font files.

previously-committed psuedo-code
rcomerand others added10 commitsDecember 12, 2025 18:41
previously-committed psuedo-code
Added pytest for new feature, rebased commitsRemoved trailing whitespaceImplemented pytest for new featureRemoved whitespaceFixed coding styleFurther fixed coding styleFurther fixed coding style. Sigh.Updated backend_ps.py to call the proper functionto get the font sizeRebased commits to only have one copy of the new base image
Removed trailing whitespace in backend_ps.pyProperly implemented the new feature frompreviously-committed psuedo-codeFixed coding styleAdded pytest for new feature, rebased commits
Removed trailing whitespaceImplemented pytest for new featureRemoved whitespaceFixed coding styleFurther fixed coding styleFurther fixed coding style. Sigh.Updated backend_ps.py to call the proper functionto get the font size
@gigoiy
Copy link
Author

@rcomer I might need some guidance on how to properly rebase my branch for a new base image. It's honestly my first time utilizing squash or rebase at all for that matter.

@rcomer
Copy link
Member

Hi@gigoiy we have instructions for interactive rebase here. Definitely make a backup copy of your branch first!

https://matplotlib.org/devdocs/devel/development_workflow.html#rewrite-commit-history

@gigoiy
Copy link
Author

@rcomer Definitely already made a backup copy before making this mess lol! I'll continue to tackle this on Monday

rcomer reacted with laugh emojircomer reacted with heart emoji

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@gigoiy@rcomer@NMertsch@ksunden

[8]ページ先頭

©2009-2025 Movatter.jp