-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
polar axes labels error with small radial range #680
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
Conversation
When it gets fixed it would be great if I can patch/update my current install so I can complete my university work. Even if I have to manually edit some files. Thanks |
…dding heuristic broke down and sent the rlabels way off of the plot axes. The new approach is to not have rpad, but to change the alignment of the rlabels depending on the quadrant of the plot. This seems to work quite well, but is perhaps slightly backward incompatible.
A possible solution is on my polar-rpad branch. Can you confirm that it resolves the issue for you? |
Michael, Just got back from vacation and work is hectic. I'll try to test this Thanks for the hard work on this. On Mon, Jan 23, 2012 at 8:51 AM, Michael Droettboom
|
Hello thanks for working so quick, I have had my head down working sorry for the late reply. I have tested the code by replacing my current lib/matplotlib/projections/polar.py file with the suggested one. My graph works perfectly with the labels nice and close to the radial lines. Its fixed, thanks very much. If you want me to test it any other way let me know, if you could provide specific instructions as its a while since I have used git. Thanks again. |
Mike, this has caused some movement in the location of the ticklabels and so is causing a few tests to fail for me. If you are happy with the new locations, you can just update the baseline images |
I've got hundreds of failures right now since upgrading to a new version of freetype -- I think if the failures look ok to you, that's good enough for me. |
OK, I just submitted some new baseline images as a PR on mdboom#8 Is this in general the best way for me to contribute to a PR you initiated? |
Thanks! Yes, that works. For really small things (which this isn't) just commenting on the lines in the PR is useful, too. |
polar axes labels error with small radial range
Hey there. When you run this example: http://matplotlib.sourceforge.net/examples/pylab_examples/polar_demo.html
and replace "ax.set_rmax(3.0)" with "ax.set_rmin(2.91); ax.set_rmax(3.01)" the r-axis labels move off of the axis.
Full example below (with the figsize changed to show where the labels go:
import matplotlib
import numpy as np
from matplotlib.pyplot import figure, show, rc, grid
radar green, solid grid lines
rc('grid', color='#316931', linewidth=1, linestyle='-')
rc('xtick', labelsize=15)
rc('ytick', labelsize=15)
force square figure and square axes looks better for polar, IMO
width, height = matplotlib.rcParams['figure.figsize']
size = min(width, height)
make a square figure
fig = figure(figsize=(6, 4))
ax = fig.add_axes([0.1, 0.1, 0.8, 0.8], polar=True, axisbg='#d5de9c')
r = np.arange(0, 3.0, 0.01)
theta = 2_np.pi_r
ax.plot(theta, r, color='#ee8d18', lw=3)
ax.set_rmin(2.91)
ax.set_rmax(3.01)
grid(True)
ax.set_title("And there was much rejoicing!", fontsize=20)
show()