# MatrixPlots with cell entries

Is there a nice way to combine `MatrixPlot`

with something else to have a label in each cell such as in this picture?

MatrixPlots with cell entries

`MatrixPlot`

with something else to have a label in each cell such as in this picture?

add a comment

1

Something like this works:

```
# make some random matrix
A = random_matrix(ZZ,7,7)
# make a graphics object consisting of the values of A
g = sum([text(str(A[j,k]),(j,k)) for j in range(7) for k in range(7)])
# matrix plot A and then combine with the text
g2=matrix_plot(A,cmap='rainbow',colorbar=True)
h = g2+g
# for some reason the graphics window resizes to the shape of the added text graphics
# regardless of whether h = g + g2 or h = g2 + g
h.SHOW_OPTIONS['xmax'] = 6.5
h.SHOW_OPTIONS['xmin'] = -.5
h.SHOW_OPTIONS['ymax'] = 6.5
h.SHOW_OPTIONS['ymin'] = -.5
# show result
h.show()
```

Image here: https://imgur.com/a/czhRS (I don't have enough points to embed it).

Asked: **
2018-02-22 11:19:50 -0600
**

Seen: **218 times**

Last updated: **Feb 26 '18**

Conditional Plot, plot f(x+iy) if g(x+iy) satisfies some kind of condition

Mystery white border around Graphics object

How do I display the full output that includes graphics?

How to plot points of size less than 1?

"showing" both input and output

"UserWarning: Matplotlib is building the font cache using fc-list." never resolves

How to generate graphs random geometric shapes?

Plot/Show Png/jpg in sagemath worksheet

Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.