Skip to content

FIX: Add mtext into RendererBase._draw_as_path() arguments#31910

Open
mervyzr wants to merge 1 commit into
matplotlib:mainfrom
mervyzr:patch-1
Open

FIX: Add mtext into RendererBase._draw_as_path() arguments#31910
mervyzr wants to merge 1 commit into
matplotlib:mainfrom
mervyzr:patch-1

Conversation

@mervyzr

@mervyzr mervyzr commented Jun 16, 2026

Copy link
Copy Markdown

PR summary

Why is this change necessary?

User might be unable to use LaTeX formatting for plots.

What problem does it solve?

Fixes the TypeError with missing positional argument for RendererBase._draw_text_as_path() by adding mtext=mtext into the arguments.

What is the reasoning for this implementation?

The function that calls RendererBase._draw_text_as_path() already includes mtext=None as a default argument. Therefore, this mtext is just passed into RendererBase._draw_text_as_path() too.

AI Disclosure

All fixes and code were done manually.

PR checklist

# PR Summary
---

Missing 1 positional argument 'mtext' in `RendererBase._draw_text_as_path()` (line 509 of `backend_bases.py`).

Small fix by including `mtext=mtext` into `RendererBase._draw_text_as_path()`.

This error happens when the user is trying to use LaTeX in matplotlib with matplotlib==3.11.0.

# AI Disclosure
---

All errors and fixes were done manually.
@github-actions

Copy link
Copy Markdown

Thank you for opening your first PR into Matplotlib!

If you have not heard from us in a week or so, please leave a new comment below and that should bring it to our attention. Most of our reviewers are volunteers and sometimes things fall through the cracks. We also ask that you please finish addressing any review comments on this PR and wait for it to be merged (or closed) before opening a new one, as it can be a valuable learning experience to go through the review process.

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

For details on testing, writing docs, and our review process, please see the developer guide.
Please let us know if (and how) you use AI, it will help us give you better feedback on your PR.

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

@story645

Copy link
Copy Markdown
Member

Thanks! Can you please add a test to ensure this works as expected?

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.

2 participants