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

unify visualize_matrix with matrix_plot #13812

Open
kcrisman opened this issue Dec 9, 2012 · 1 comment
Open

unify visualize_matrix with matrix_plot #13812

kcrisman opened this issue Dec 9, 2012 · 1 comment

Comments

@kcrisman
Copy link
Member

kcrisman commented Dec 9, 2012

This function (in sage.matrix.matrix_modn_sparse and perhaps elsewhere) gives pngs that show up in the current working directory, which is not standard Sage behavior for graphics. In particular, in the notebook and EMBEDDED_MODE they don't show up at all, anywhere (unless you have admin access, I suppose).

At #13807 (where this was originally not working anyway due to a previous bugfix), it is pointed out that visualize_matrix does one thing that matrix_plot does not: it lets you put a bound on the size of the figure, and then scales the picture accordingly. So if you have a 20x20 matrix and plot it in a 10x10 picture, each pixel corresponds to the entries in a 2x2 block.

There we thought it might make sense to merge this functionality into matrix_plot and then deprecate visualize_matrix, which after all dates from 2007. But maybe there is a reason not to do this? Anyway, any more consistent behavior would be nice here.

CC: @jhpalmieri @jasongrout @malb

Component: graphics

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

@malb
Copy link
Member

malb commented Dec 9, 2012

comment:1

I wrote visualize_structure() back in the day for visualising the structure of dense (!) matrices over GF(2). Currently, matrix_plot() doesn't behave as nicely as visualize_structure() for these matrices:

  • by default zero is plotted black and one is plotted white
  • structure visualisation (non-zero vs. zero) is only available for sparse matrices, but it should be also available for dense matrices (those can be structured too).

Currently, both visualize_structure() and matrix_plot() seem to behave the same performance wise. We should allow a matrix to plot itself though, i.e., allow specialised code which is called by matrix_plot(). For example, the M4RI library can plot matrices and it is a lot faster than what we have in Sage.

@jdemeyer jdemeyer modified the milestones: sage-5.11, sage-5.12 Aug 13, 2013
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.1, sage-6.2 Jan 30, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.2, sage-6.3 May 6, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.3, sage-6.4 Aug 10, 2014
@mkoeppe mkoeppe removed this from the sage-6.4 milestone Dec 29, 2022
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

6 participants