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

Make spy() output nicer plots by default #777

Merged
merged 1 commit into from
Dec 31, 2015

Conversation

mortenpi
Copy link
Contributor

A small rewrite of the spy() function to get better defaults. The differences compared to the current one are

  • the axes now are now compactly around the matrix, whereas previously there
    was quite a lot of empty space, depending on the dimensions of the matrix
  • the aspect ratio of the axes is 1:1 by default, since squares look better
  • zeroes now get drawn, but NaNs get filtered out (currently zeros leave holes and NaNs make it crash)

Everything can still be overridden by passing a custom Coord or Scale, so I do not think that this forces the user into anything, but these are better defaults if you just want to take a quick look at some arbitrary matrix.

I.e. we go from this
spytest
to this
spytest-fixed
Plots produced by this simple script: https://gist.github.com/mortenpi/24730ed5f1b6de8976a4

Two primary differences compared to the previous implementation:
  - the axes now are now compactly around the matrix, whereas previously there
    was quite a lot of empty space, depending on the dimensions of the matrix
  - zeroes now get drawn, but NaNs get filtered out
@darwindarak
Copy link
Collaborator

Looks great! I'll merge it in a day or two if no objections are raised.

@simleb
Copy link
Contributor

simleb commented Dec 30, 2015

👍

darwindarak added a commit that referenced this pull request Dec 31, 2015
Make spy() output nicer plots by default
@darwindarak darwindarak merged commit f6bab11 into GiovineItalia:master Dec 31, 2015
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.

None yet

3 participants