Hi everyone, I am Zareef, and I am very new to contributing to open source projects. I was wondering if me and my friend could contribute to this issue for a class at my university.
@safdarzareef You are very welcome to contribute if you think you're basically able to resolve the issue. While we're available for targeted questions, we don't have the capacity for close mentoring (We had some bad experiences in the past from university class contributors that essentially needed as step-by-step guidance how to approach and resolve the issue).
Also there's already a proposed patch #19114. So first step would be to check that and determine if this is a good approach and only needs some additions.
changed the title [-]Center of rotation for text with roatation_mode='anchor'[/-][+]Center of rotation for text with rotation_mode='anchor'[/+]on Apr 20, 2021
This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!
@evelyn-lo sure. This is a classic debug topic. You need to find out why the behavior is like it is. It's likely somewhere in the numerics of the calculation.
Activity
timhoffm commented on Jul 7, 2020
Labelled as
tacaswell commented on Jul 12, 2020
We should also check that this is consistent between the backends (ie, png / svg / pdf all have the same problem).
dzh527 commented on Jul 15, 2020
@timhoffm Looks like the problem is not with the rotation center, but with the bounding box and the text:
and this will produce

safdarzareef commented on Apr 6, 2021
Hi everyone, I am Zareef, and I am very new to contributing to open source projects. I was wondering if me and my friend could contribute to this issue for a class at my university.
timhoffm commented on Apr 7, 2021
@safdarzareef You are very welcome to contribute if you think you're basically able to resolve the issue. While we're available for targeted questions, we don't have the capacity for close mentoring (We had some bad experiences in the past from university class contributors that essentially needed as step-by-step guidance how to approach and resolve the issue).
Also there's already a proposed patch #19114. So first step would be to check that and determine if this is a good approach and only needs some additions.
github-actions commented on May 26, 2023
This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!
coder-brunette commented on Sep 22, 2023
Is this issue still open? If yes, does this make sense or look little better? @timhoffm
seems like it handles this issue -> The vertical position of the rotation point is not exactly at y=0.5 (slightly shifted down).
tacaswell commented on Sep 22, 2023
Update: This still seems to be a problem and the issue appears to be related to the bounding box of the rotated text not being correct.

coder-brunette commented on Sep 23, 2023
@tacaswell tried making this change!
import matplotlib.pyplot as plt import numpy as np def add_rotated_text(ax, text, x, y, angle, size=50, color='black', bbox_pad=0): rotation_rad = np.deg2rad(angle) x_adjusted = x + 0.03 * np.cos(rotation_rad) y_adjusted = y + 0.03 * np.sin(rotation_rad) text_obj = ax.text( x_adjusted, y_adjusted, text, size=size, rotation=angle, va='center', rotation_mode='anchor', color=color ) # Set a fixed padding value for the bounding box text_obj.set_bbox(dict(facecolor='None', edgecolor='red', pad=bbox_pad)) # Create a 2x2 grid of subplots fig, axes = plt.subplots(2, 2) # Loop through subplots and add rotated text for idx, ax in enumerate(axes.flatten()): ax.axvline(.5, linewidth=.5, color='.5') ax.axhline(.5, linewidth=.5, color='.5') add_rotated_text(ax, 'pP', .5, .5, idx*90, bbox_pad=0) # Specify bbox_pad here # Add labels and title fig.suptitle('Rotated Text Example') axes[1, 0].set_xlabel('X-axis') axes[1, 1].set_xlabel('X-axis') axes[0, 0].set_ylabel('Y-axis') axes[1, 0].set_ylabel('Y-axis') plt.show()evelyn-lo commented on Apr 20, 2025
@timhoffm Hello! I'm Evelyn, and I'm interested in helping resolve this issue. Can me and my friends work on this issue?
timhoffm commented on Apr 21, 2025
@evelyn-lo sure. This is a classic debug topic. You need to find out why the behavior is like it is. It's likely somewhere in the numerics of the calculation.
sahil-11116 commented on Mar 5, 2026
Hi, I’m a new contributor interested in working on this issue. If it’s still available, I’d like to investigate it and try implementing a fix.
QuLogic commented on Mar 19, 2026
#29199 will fix this; there is no need to work on this now.
QuLogic commented on Apr 10, 2026
The text-overhaul branch is now merged to main.