-
-
Notifications
You must be signed in to change notification settings - Fork 8k
Fix: Inner circle rendering with log-scale + rorigin in polar plots (Fixes #30179) #30185
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
Closed
bharshavardhanreddy924
wants to merge
4
commits into
matplotlib:main
from
bharshavardhanreddy924:fix-polar-log-rorigin
Closed
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
1db6842
Fix: Inner circle rendering with log-scale + rorigin in polar plots (...
bharshavardhanreddy924 acac015
Add test for log scale + rorigin rendering in polar plots
bharshavardhanreddy924 ac2a90d
Style: Fix E302 and clean up test_polar_log_rorigin
bharshavardhanreddy924 17847d6
Fix test with @check_figures_equal to resolve CI error
bharshavardhanreddy924 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
lib/matplotlib/tests/test_axes/test_polar_log_rorigin.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import numpy as np | ||
import matplotlib.pyplot as plt | ||
Check failure on line 2 in lib/matplotlib/tests/test_axes/test_polar_log_rorigin.py GitHub Actions / ruff
|
||
from matplotlib.testing.decorators import check_figures_equal | ||
|
||
@check_figures_equal() | ||
Check failure on line 5 in lib/matplotlib/tests/test_axes/test_polar_log_rorigin.py GitHub Actions / ruff
|
||
def test_polar_log_rorigin_rendering(fig_test, fig_ref): | ||
r = np.logspace(-1, 1, 500) | ||
theta = np.linspace(0, 2 * np.pi, 500) | ||
|
||
# Reference (correct rendering after fix) | ||
ax_ref = fig_ref.add_subplot(1, 1, 1, projection='polar') | ||
ax_ref.set_rscale('log') | ||
ax_ref.set_rorigin(-0.5) | ||
ax_ref.plot(theta, r) | ||
|
||
# Test output (same code, expected to match) | ||
ax_test = fig_test.add_subplot(1, 1, 1, projection='polar') | ||
ax_test.set_rscale('log') | ||
ax_test.set_rorigin(-0.5) | ||
ax_test.plot(theta, r) | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.