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

matrix_plot can now plot subdivisions #10847

Closed
jasongrout opened this issue Feb 24, 2011 · 23 comments
Closed

matrix_plot can now plot subdivisions #10847

jasongrout opened this issue Feb 24, 2011 · 23 comments

Comments

@jasongrout
Copy link
Member

This patch makes matrix_plot learn about plotting subdivisions.


Apply

CC: @rbeezer @kcrisman @sagetrac-ryan

Component: graphics

Author: Jason Grout

Reviewer: Karl-Dieter Crisman, John Palmieri

Merged: sage-4.7.alpha5

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

@jasongrout
Copy link
Member Author

@jasongrout
Copy link
Member Author

comment:1

I think this is ready for review. I was trying to create a graph like in the Wikipedia page on DCT (http://en.wikipedia.org/wiki/File:Dctjpeg.png), but we didn't support plotting matrix subdivisions and adding lines to a matrix plot was messing it up.

Well, it all works beautifully now, after this patch! :).

@kcrisman
Copy link
Member

comment:3

This is such a great patch, really nicely put together and documented, everything. I really want to say positive review, except plotting sparse matrices now does not work.

sage: sparse = matrix(dict([((randint(0, 10), randint(0, 10)), 1) for i in xrange(100)])); matrix_plot(sparse)
<snip>
AttributeError: Unknown property subdivisions

I have no idea how to fix this - all the obvious things I tried, including adding to the list of options deleted for sparse plotting, or deleting this options after creating the lines, did not work. I must be missing something pretty obvious, I guess, but since this is one of the doctest examples it now fails the tests and obviously this needs work!

@kcrisman
Copy link
Member

Reviewer: Karl-Dieter Crisman

@rbeezer
Copy link
Mannequin

rbeezer mannequin commented Mar 13, 2011

comment:4

Replying to @kcrisman:

AttributeError: Unknown property subdivisions

Matrices have a function subdivision() and an attribute subdivisions.

sage: A= matrix(2, range(4))
sage: type(A.subdivision)
<type 'builtin_function_or_method'>
sage: type(A.subdivisions)
<type 'NoneType'>

The latter should go away, see #4983. Maybe it is not visible outside of a *.pyx file?

Anyway, hope this helps some.

@kcrisman
Copy link
Member

comment:5

Well, for some reason doing the right thing (adding to the deleted options for sparse matrices) worked this morning. Patch coming up, once I run relevant tests.

@kcrisman
Copy link
Member

Attach after main patch

@kcrisman
Copy link
Member

comment:6

Attachment: trac_10847-reviewer.patch.gz

Okay, now all is well, unless someone is really tricky and circumvents the decorators and explicitly removes the subdivision keyword. That would also be true for circumventing the vmin keyword, so I judge it to be a non-issue. Positive review.

Apply attachment: trac-10847-matrix_plot-subdivisions.patch and attachment: trac_10847-reviewer.patch

@kcrisman

This comment has been minimized.

@jasongrout
Copy link
Member Author

comment:8

#4983 probably conflicts with this patch.

@jasongrout
Copy link
Member Author

comment:9

(where "conflicts" means that #10847 probably needs to be changed after this patch too.)

@kcrisman
Copy link
Member

comment:10

It would be nice if a patch that has had positive review for over a week did not have to be rebased for a patch that has had positive review for seven hours. Could that patch not be based on this instead?

@jhpalmieri
Copy link
Member

apply on top of other patches

@jhpalmieri
Copy link
Member

comment:11

Attachment: trac_10847-4983-fix.patch.gz

I think this patch should fix any incompatibilities with #4983. With this, you can apply the patches here independently of #4983.

@jhpalmieri

This comment has been minimized.

@jasongrout
Copy link
Member Author

comment:12

But I thought #4983 got rid of the get_subdivisions() command. Won't you have a problem when you apply #4983 now?

@jhpalmieri
Copy link
Member

comment:13

#4983 keeps get_subdivisions as a synonym for "subdivisions", for backwards compatibility.

@rbeezer
Copy link
Mannequin

rbeezer mannequin commented Mar 23, 2011

comment:14

Replying to @jasongrout:

But I thought #4983 got rid of the get_subdivisions() command. Won't you have a problem when you apply #4983 now?

#4983, as of about mid-day yesterday, said

Here's patch. This keeps get_subdivisions as a synonym for subdivisions. 

So it was never slated for removal.

@jasongrout
Copy link
Member Author

comment:15

Thanks. I didn't read that patch carefully enough, apparently.

@rbeezer
Copy link
Mannequin

rbeezer mannequin commented Mar 23, 2011

comment:16

I applied #4983, then all the patches here. Passed long tests and patch looks good. So I'll check off on John P's patch as an interested observer, and leave this at positive review.

@kcrisman
Copy link
Member

comment:17

Wow, thanks for the quick work, guys!

@kcrisman
Copy link
Member

Changed reviewer from Karl-Dieter Crisman to Karl-Dieter Crisman, John Palmieri

@jdemeyer
Copy link

Merged: sage-4.7.alpha5

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