Questions tagged [tikz-matrix]

{tikz-matrix} concerns matrix nodes particularly in the tikz-matrix library of tikz-pgf.

80 questions
Filter by
Sorted by
Tagged with
3k views

Why are empty and non empty TikZ matrix cells not equally placed?

I wanted to draw an almost empty matrix of nodes with TikZ similar to the left most one below. All nodes would have same size (through minimum width and minimum height) and no separation between ...
4k views

TikZ matrix, style for combination or rows and columns

In the TikZ manual we have the example below that shows how to apply an style to an entry of the matrix. It is also easy to apply it for an entire row and an entire column. My question is how can we ...
2k views

Compilation problem with tikz diagram

As I said, I'm writing math books for school; one of them is about matrices and I have several problems with it. It's a big code, so I'm trying to summarize it: Problem with TikZ matrix: When I try ...
7k views

How to force nodes to have the same size in tikz matrices

Is there some intelligent way to have several tikz nodes have the same height and width? Consider the following example with output below. I'd like every node in each row to have the same height ...
753 views

What is the best way to create this kind of binary matrix?

Like the fig 2. on page 3 of Relations in Mathematical Morphology with applications to Graphs and Rough Sets, John G. Stell Thank you!
2k views

How to insert a linebreak in a TikZ matrix node?

How can I get a linebreak inside a matrix node? The following gives the error: Package tikz Error: Giving up on this path. Did you forget a semicolon?. unless I remove the linebreak. \...
2k views

How to fix a certain distance between a TikZ matrix border and its nodes?

I want to draw a TikZ matrix with its border and I would like to define the distance between most external matrix nodes and matrix border. Something like a matrix inner sep. If I change inner sep in ...
845 views

positioning of a matrix bigger than margins

A document I'm working on has a table that was complicated enough for me to try and make it using a pgf matrix of nodes. However, the resulting matrix ended up being slightly too big for the page. I'...
5k views

Problems with Beamer and diagrams in Tikz

I did a commutative diagram with tikz in the article class and everything works. The next code is the MWE in article class. \documentclass{article} \usepackage{tikz} \usetikzlibrary{matrix} \begin{...
4k views

tikz matrix: color entire row

Goal: I would like to color entire rows of a tikz matrix. Background: I did some googling, and I got the following. Debugging: I know what is wrong (it's only coloring the individual nodes, rather ...
3k views

Striking out matrix lines and columns: is Tikz the only way?

I would like to show a matrix with "strike-out lines" on some of its rows and columns. After some research I found a solution using Tikz matrices, which I reproduce here: \documentclass{article} \...
5k views

Using brackets as delimiters for matrix in TikZ-PGF Matrix Library

The TikZ-PGF manual is clear that for the matrix library, the delimiters are parentheses and braces: Delimiters are parentheses or braces to the left and right of a formula or a matrix. I ...
804 views

How to have a specific style for empty cells in a tikz matrix

I have a tikz matrix as the one in the code below which contains some empty cells. (Don't care about issues with column and row separations. I left that out for the sake of simplicity.) \...
988 views

TikZ matrix delimiters are too big

I want to make a matrix with TikZ so I can put some fancy colored boxes around some elements, but I'm running into a problem: the parentheses around the matrix are too big and too far apart from the ...
672 views

Drawing a really large binary matrix as colored grid

I have a 50x300 binary marix, which I want to display as a colored grid. I tried the approaches of drawing a large binary matrix as colored grid which I like, but the approach using pgfplots table is ...
8k views

Creating table using TikZ matrix

I'm trying to create a table in TikZ with the first column right-aligned, and the texts in each cell on the same line the rest of the columns center-aligned, and each has width of 1cm My attempt is ...
98 views

Why is my \matrix path failing when put inside another macro? [duplicate]

I've have the following two pieces of code. The first one compiles; the second one doesn't. I don't understand why the second one fails. Could someone explain? Example 1: \documentclass{article} \...
3k views

How to overlay tikz matrix in beamer?

Background: I encounter some unexpected situations while overlaying a tikz matrix in Beamer. The latex code is given at the end (note: you can also read and copy it at ShareLatex:TikzMatrixOverlay). ...
2k views

Levi-Civita symbol: 3D matrix

During the current review of the tensors I have arrived at a page of Wikipedia where you can see the symbol of Levi-Civita in a beautiful three-dimensional matrix. I hope that nobody will be angry ...
1k views

Drawing this matrix using Tikz

I have a matrix which has certain properties. To illustrate these properties, I would like to generate the following image using Tikz: Additionally, I would like the following things on the image: ...
664 views

How to create a correctly aligned tree proof in logic with 4 branches, columns of line numbers and justifications?

I'm looking for a way to make a Logic Tree with three columns (line number, tree itself and commentary). I've tried using a tikz matrix, and it worked very well, except when I get more than two ...
948 views

Drawing multiple iterations of cellular automatons inline, possibly with TikZ

I want to illustrate the iterations of a cellular automaton picture-by-picture in some slides. For those not familiar with the topic, imagine a two-dimensional grid of square cells where each square ...
621 views

Highlight elements in the matrix in tikz

I have a matrix and need to highlight some elements in the matrix as in the example. Thanks \documentclass{beamer} \usepackage{tikz} \usetikzlibrary{calc,arrows,automata,positioning} \usepackage{...
318 views

how can I create keys such as “column … to …” for a TikZ matrix

I have a node style I would like to apply to many (but not all) the cells/columns/rows of a matrix of nodes. Currently, for every column or cell that I want the style to apply to, I declare the style ...
847 views

Need some help getting started with TikZ, groupplots and color mapping of matrix

I used Python to make the plot shown below (saved as png). It should have a common colorbar and all data is read from a h5 file, but I thought saving it to a txt file or something using a Python ...
522 views

Determine number of columns in TikZ matrix

Given a macro that accepts a matrix as an argument \newcommand{tabler}[1]{\matrix(m)[matrix of nodes, ampersand replacement=\&]{#1};} I would like to determine the number of columns in matrix m, ...
154 views

How to circle together certain entries of a matrix?

I am looking for a way to circle together the red entries of the following matrix:  \begin{matrix} \textcolor{blue}{[0,1]} & \times & \textcolor{blue}{[0,1]} & \times & \...
1k views

TikZ: Image Matrix - shifting connected paths

I currently use TikZ matrix for arranging images and their nodes for putting some labels on the edges. Take a look at the attached image. For some reason, i am unable to shift connected paths. For ...
488 views

How may I insert horizontal dots in the second row of my vmatrix?

It seems to me that my method is quite inconvenient. Could someone help me in this matter? \documentclass[11pt,a4paper]{article} \usepackage{blindtext} \usepackage{mathtools} \...
87 views

Problem using \pgfmatrixcurrentrow for labels in matrix of nodes style definition

Following code shows four different ways of adding a label with its column and row value for certain nodes in a matrix or matrix of nodes. The problem is that the fourth way (commented in code) doesn'...
355 views

Matrixcells problem with the y-axis only

I observe a strange behavior with matrixcells.dtx by @AndrewStacey. The cells give me a complete tiling but when some rows are taller than average the tiling is shifted (see pictures and example below)...
882 views

Simpler solution of “Table cell color overlaps cell border”?

I have seen many discussions about "Table cell color overlaps cell border". I want to share my try on this problem. Also, I am a beginner in latex, my code may not be the best, I would like to see if ...
99 views

Matrix with uneven element lengths

From the answer to this question When editing the elements of the matrix to become uneven in length, the display of the matrix becomes disturbed. How can this be solved \documentclass{beamer} \...
1k views

Is it possible to add node labels to some matrix column or row when building it?

I want this: which is done with \documentclass[border=2mm,tikz]{standalone} \usetikzlibrary{matrix} \begin{tikzpicture}[ mygridmatrix/.style={matrix of nodes, row sep=-\pgflinewidth, ...
264 views

Drawing some specific shapes on a matrix using Tikz

I am new to using Tikz and, I have a matrix which is the sum of three matrices L, D, U. To illustrate these parts, I would like to generate the following image using Tikz: How can I do that, any help ...
4k views

Simple visualization of 3D matrix

I need to visualize 3D matrix in a way similar to this one: There are no arrows needed, I only want to have all 2D arrays fully visible, one "behind" each other and their corners connected by lines. ...
2k views

Spanning a cell across several rows in TikZ-matrix

Using the matrix-library of TikZ I am producing the following image: \documentclass[tikz]{standalone} \usetikzlibrary{matrix} \begin{document} \begin{tikzpicture}[auto, node distance=2cm,font=\...
598 views

TikZ : Drawing a Triangular Block Matrix

I'm trying to draw a matrix like this one in the picture with extremely low success. The code of what I've tried so far is the following \documentclass[letterpaper,11pt]{article} \usepackage{tikz} \...
2k views

How to make a full equation with tikz?

I am using this solution here to make long dashes within a matrix, and it is working well. The code is: \documentclass{article} \usepackage{tikz} \usetikzlibrary{matrix} % possible to customize here ...
924 views

Borders of a matrix are not well placed

I have the following code: \documentclass{article} \usepackage{tikz} \usetikzlibrary{matrix} \colorlet{mlightgray}{gray!20} \begin{document} \begin{tikzpicture}[cell/.style={rectangle,draw=black}, ...
2k views

Alignment problem of empty cells when doing multirow/multicolumn cells in TikZ matrices

This is a question which has been discussed here and here. One of the solution discussed is to use fit to cover empty cells. However, while trying it, it displayed an alignment problem between the ...
2k views

How do I make a TikZ matrix match height?

I'm trying to make a table using the matrix TikZlibrary. The problem is that the height does not match. \documentclass[tikz,border=2pt]{standalone} \usetikzlibrary{matrix} \usepackage[utf8]{inputenc}...
168 views

Separating matrix elements by lines

Using the following code \documentclass{beamer} \beamertemplatenavigationsymbolsempty \usepackage{verbatim} \usepackage{tikz} \usepackage{pgfplots} \usetikzlibrary{arrows, arrows.meta} \...
354 views

How to make TikZ matrix start a new row automatically when certain column number is reached?

I wish to set the maximum column count in a TikZ matrix and, if I start a new cell when the maximum count is reached, LaTeX would put the cell in a new row. One approach would be a command which ...
852 views

tikz matrix align/decorate cellpictures

I have a matrix of cell pictures, and want the first column to be right aligned and the second column to be left aligned. However I have trouble using the "nodes" key. example \documentclass{article}...
235 views

TikZ: matrix in a matrix gives “missing \$”

The following TikZ code compiles and renders as expected: \matrix[struct] { \node[varname] (age) {age}; & \node[vartype] {int*}; \\ \node[varname] {height}; & \node[vartype] {float}; \...
188 views

Extract the tikzpicture matrix dimension

If I have this matrix code, \begin{tikzpicture} \matrix[matrix of math nodes, anchor=south west, nodes={ draw=red, align=center, inner sep=0pt, text width=1cm - \pgflinewidth, ...
829 views

Cannot compile “Matrix multiplication” example from texample.net

The example Matrix Multiplication fails to compile. From this answer I gathered that something changed in TikZ 3.0, but since the answer does not really explain what one should change, I'm stuck as ...