FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

polar axes labels error with small radial range by mdboom · Pull Request #680 · matplotlib/matplotlib · GitHub

Repository navigation

polar axes labels error with small radial range - #680

Merged
jdh2358 merged 2 commits into
matplotlib:v1.1.xfrom
mdboom:polar-rpad
Feb 27, 2012
Merged

jdh2358 merged 2 commits into
matplotlib:v1.1.xfrom
mdboom:polar-rpad

Conversation

mdboom commented Jan 23, 2012

Copy link
Copy Markdown
Member

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()

ghost assigned mdboom Jan 17, 2012

Copy link
Copy Markdown

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.

mdboom commented Jan 23, 2012

Copy link
Copy Markdown
Member

A possible solution is on my polar-rpad branch. Can you confirm that it resolves the issue for you?

phobson commented Jan 23, 2012

Copy link
Copy Markdown
Member Author

Michael,

Just got back from vacation and work is hectic. I'll try to test this
out on a VM later tonight.

Thanks for the hard work on this.
-paul

On Mon, Jan 23, 2012 at 8:51 AM, Michael Droettboom
reply@reply.github.com
wrote:

A possible solution is on my polar-rpad branch.  Can you confirm that it resolves the issue for you?


Reply to this email directly or view it on GitHub:
#680 (comment)

Copy link
Copy Markdown

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.

jdh2358 commented Feb 26, 2012

Copy link
Copy Markdown
Collaborator

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

mdboom commented Feb 27, 2012

Copy link
Copy Markdown
Member

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.

jdh2358 commented Feb 27, 2012

Copy link
Copy Markdown
Collaborator

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?

mdboom commented Feb 27, 2012

Copy link
Copy Markdown
Member

Thanks! Yes, that works. For really small things (which this isn't) just commenting on the lines in the PR is useful, too.

jdh2358 added a commit that referenced this pull request Feb 27, 2012
polar axes labels error with small radial range
jdh2358 merged commit eb95530 into matplotlib:v1.1.x Feb 27, 2012
mdboom deleted the polar-rpad branch March 3, 2015 18:44
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL