Skip to content
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

Warnings in plot_slope_field #12277

Closed
novoselt opened this issue Jan 7, 2012 · 9 comments
Closed

Warnings in plot_slope_field #12277

novoselt opened this issue Jan 7, 2012 · 9 comments

Comments

@novoselt
Copy link
Member

novoselt commented Jan 7, 2012

Duplicate of #11208

If I do (in Sage 4.7.2 or 4.8.alpha6)

plot_slope_field(1, (1,2), (3,4))

(or anything else that I have tried), then in front of the plot, which looks as expected, I get

Warning: divide by zero encountered in divide
Warning: invalid value encountered in multiply
Warning: invalid value encountered in multiply
Warning: divide by zero encountered in divide
Warning: invalid value encountered in multiply
Warning: invalid value encountered in multiply

My investigation so far shows: this function is a little wrapper for plot_vector_field which sets new defaults for three options. If headlength is set to 0, there are warnings.

A possible workaround is to set it to something small: 0.001 seems to work on the screen. However, since with headaxislength=0 and headlength=0.2 I definitely see "a hair on the end", it does not seem to be satisfactory from a perfectionist point of view (and producing vector formats that may be scaled or printed with high resolution).

Besides, current settings do produce the accurate plot, it just shows warnings that should not be there, and I have no idea how to fix it.

CC: @jasongrout

Component: graphics

Reviewer: Karl-Dieter Crisman, Andrey Novoseltsev

Issue created by migration from https://trac.sagemath.org/ticket/12277

@jasongrout
Copy link
Member

comment:1

It seems like I remember that this was fixed in the new matplotlib 1.1.0 release (an spkg is up on trac somewhere).

@jasongrout
Copy link
Member

comment:2

Ah yes, #11915. Do you still see the problem after applying that spkg?

@novoselt
Copy link
Member Author

novoselt commented Jan 8, 2012

comment:3

Replying to @jasongrout:

Ah yes, #11915. Do you still see the problem after applying that spkg?

Yes, the same issue both in 4.7.2 and 4.8.alpha6 with #11915 applied. Are these warnings coming from matplotlib? Also, what would be an appropriate doctest for this bug?

@kcrisman
Copy link
Member

comment:4

This is a dup of #11208? Probably. See also #2922.

@novoselt

This comment has been minimized.

@novoselt
Copy link
Member Author

comment:5

Yes, strange I couldn't find it, I tried to search... My current workaround is that I have redefined plot_slope_field. It is in a way good, since I also had to fix aspect ratio (for 4.7.2) and changed defaults for colour and frame to match the textbook I am using.

@novoselt novoselt removed this from the sage-5.0 milestone Jan 10, 2012
@novoselt
Copy link
Member Author

comment:7

Am I supposed to do anything with author/reviewer fields?

@kcrisman
Copy link
Member

comment:8

One puts the reviewers only to those who realized, it, at least in the usage lately. If I misspelled your name, just fix it.

@kcrisman
Copy link
Member

Reviewer: Karl-Dieter Crisman, Andrey Novoseltsev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants