Opened 8 years ago

Last modified 7 years ago

#13812 new enhancement

unify visualize_matrix with matrix_plot

Reported by: kcrisman Owned by: jason, was
Priority: minor Milestone: sage-6.4
Component: graphics Keywords:
Cc: jhpalmieri, jason, malb Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges


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.

Change History (5)

comment:1 Changed 8 years ago by malb

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.

comment:2 Changed 8 years ago by jdemeyer

  • Milestone changed from sage-5.11 to sage-5.12

comment:3 Changed 7 years ago by vbraun_spam

  • Milestone changed from sage-6.1 to sage-6.2

comment:4 Changed 7 years ago by vbraun_spam

  • Milestone changed from sage-6.2 to sage-6.3

comment:5 Changed 7 years ago by vbraun_spam

  • Milestone changed from sage-6.3 to sage-6.4
Note: See TracTickets for help on using tickets.