0

A pixel diagram is a way to visualize a graph, or even the non-zero entries in a matrix. It is typically used to help visualize graphons. I am trying to use Tikz to draw these diagrams. An example can be seen below (taken from here)

enter image description here

So the idea is as follows: for a square n x n matrix, draw an n x n grid, and make the i-jth pixel black if the i-jth element of the matrix is non-zero (or there is an edge between nodes i and j).

Is it possible to enter a data file containing the matrix data and have tikz generate the pixel diagram? I am very much a tikz novice and don't even know where to begin here...

thanks!

AndréC
  • 24,137
1yen
  • 351
  • See https://tex.stackexchange.com/questions/157080/can-tikz-create-pixel-art-images. Is it perhaps a duplicate of your question? – Steven B. Segletes Aug 23 '19 at 15:34
  • @Steven B. Segletes - Thanks for the link! this is indeed very close to what I am after, so I will study it and see how it goes! – 1yen Aug 23 '19 at 15:42
  • See https://tex.stackexchange.com/a/123728, which really plots it from a data file. There is also matrix plot which comes with pgfplots. –  Aug 23 '19 at 15:44

0 Answers0