Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

polar plots do not properly handle units#4905

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
jrevans wants to merge3 commits intomatplotlib:masterfromjrevans:issue04

Conversation

jrevans
Copy link

PolarAxes was not properly handling unitized data

This addresses an issue in#4897.

angles = np.asarray(angles, np.float_)
self.set_xticks(angles * (np.pi / 180.0))
else:
# The unit converters are defined to return radians
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Silly question, where is this documented/implemented?

@tacaswelltacaswell added this to thenext point release milestoneAug 11, 2015
self.set_xticks(angles * (np.pi / 180.0))
if isinstance( angles[0], float ):
# If the data is floats it is assumed to be degrees (as per the
# docsting for this method)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

docstring

@QuLogic
Copy link
Member

Side note: there's no reason to prefix your commit messages with your initials; that's why you set your author info before committing anything.

@@ -399,6 +399,8 @@ def set_theta_offset(self, offset):
"""
Set the offset for the location of 0 in radians.
"""
# Make sure to strip away units
offset = self.convert_yunits(offset)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Andx here too.

@tacaswell
Copy link
Member

Added more test cases to test polar functions.
@jrevans
Copy link
Author

When moving my fixes over to git, I had accidentally transposed which axis was used for the unit conversion. I have fixed that.

I have also added some more test cases to test for this. I am not sure what the process is for generating the baseline images or even running the test harness anymore. It has changed dramatically from when I first wrote it up so many years ago. What is the process for this now?

@tacaswell
Copy link
Member

See
http://matplotlib.org/devel/testing.html#writing-an-image-comparison-test
for the current directions

On Mon, Aug 17, 2015, 3:54 PM James Evansnotifications@github.com wrote:

When moving my fixes over to git, I had accidentally transposed which axis
was used for the unit conversion. I have fixed that.

I have also added some more test cases to test for this. I am not sure
what the process is for generating the baseline images or even running the
test harness anymore. It has changed dramatically from when I first wrote
it up so many years ago. What is the process for this now?


Reply to this email directly or view it on GitHub
#4905 (comment)
.

@WeatherGod
Copy link
Member

Essentially, just run the test directly (after installing the latest
changess). So, from the root source directory:python lib/matplotlib/tests/test_foobar.py). It'll run and error on the new test,
but it will produce artifacts like
"result_images/test_foobar/this_new_test_image.png". Verify the new
artifacts are right and then copy them over to
"lib/matplotlib/tests/baseline_images/test_foobar/". Rerun the test to make
sure all is well, and then add and commit those images.

On Mon, Aug 17, 2015 at 3:54 PM, James Evansnotifications@github.com
wrote:

When moving my fixes over to git, I had accidentally transposed which axis
was used for the unit conversion. I have fixed that.

I have also added some more test cases to test for this. I am not sure
what the process is for generating the baseline images or even running the
test harness anymore. It has changed dramatically from when I first wrote
it up so many years ago. What is the process for this now?


Reply to this email directly or view it on GitHub
#4905 (comment)
.

@tacaswell
Copy link
Member

ping@jrevans Any update on this?

theta /= math.pi
# \u03b8: lower-case theta
# \u03c0: lower-case pi
# \u00b0: degree symbol
return '\u03b8=%0.3f\u03c0 (%0.3f\u00b0), r=%0.3f' % (theta, theta * 180.0, r)
s = '\u03b8=%0.3f\u03c0 (%0.3f\u00b0), r=%0.3f' % (theta, theta * 180.0, r)
s = s.encode( 'utf-8' )
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This shouldn't be necessary and probably indicates a bug somewhere else. Returning unicode from this function is actually what wewant. Can you describe which backend/platform you were using when you can across this problem?

@mdboommdboom self-assigned thisOct 8, 2015
@mdboom
Copy link
Member

@jrevans: Any progress on addressing the questions above? We may have to punt on this for 1.5.0.

@jrevansjrevans mentioned this pull requestOct 28, 2015
17 tasks
@tacaswelltacaswell modified the milestones:next point release (1.5.0),next bug fix release (2.0.1)Oct 29, 2015
@@ -411,6 +411,107 @@ def test_polar_units():
assert_true(isinstance(plt.gca().get_xaxis().get_major_formatter(), units.UnitDblFormatter))


def test_polar_format_coord():
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This needs a@cleanup decorator so global state does not leak.

@QuLogicQuLogic modified the milestones:2.0.1 (next bug fix release),2.0.2 (next bug fix release)May 3, 2017
@tacaswelltacaswell modified the milestones:2.1.1 (next bug fix release),2.2 (next feature release)Oct 9, 2017
@jklymak
Copy link
Member

I'm not going to close this one because it looks like it was close, but is there any chance it will get some movement? Someone who loves units will need to lead the charge...

@jklymak
Copy link
Member

Closing this as not likely to be resurrected, but feel free to request a re-open.

@story645story645 removed this from thefuture releases milestoneOct 6, 2022
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees

@mdboommdboom

Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

8 participants
@jrevans@QuLogic@tacaswell@WeatherGod@mdboom@jklymak@story645@dstansby

[8]ページ先頭

©2009-2025 Movatter.jp