tikz grid without top edgeTikZ (finite) grid with character in each cellLaTeX equivalent of ConTeXt buffersHow to define the default vertical distance between nodes?Numerical conditional within tikz keys?TikZ/ERD: node (=Entity) label on the insideWhy do I get an extra white page before my TikZ picture?TikZ: Drawing an arc from an intersection to an intersectionHow to prevent rounded and duplicated tick labels in pgfplots with fixed precision?Drawing rectilinear curves in Tikz, aka an Etch-a-Sketch drawingLine up nested tikz enviroments or how to get rid of themHow to draw a square and its diagonals with arrows?
Unlock My Phone! February 2018
Is it possible to static_assert that a lambda is not generic?
Is there an expression that means doing something right before you will need it rather than doing it in case you might need it?
Why didn't Boeing produce its own regional jet?
What's the meaning of "Sollensaussagen"?
How would I stat a creature to be immune to everything but the Magic Missile spell? (just for fun)
How can a day be of 24 hours?
Does the Idaho Potato Commission associate potato skins with healthy eating?
Fair gambler's ruin problem intuition
Different meanings of こわい
Is there a hemisphere-neutral way of specifying a season?
Array of objects return object when condition matched
Does Dispel Magic work on Tiny Hut?
Can someone clarify Hamming's notion of important problems in relation to modern academia?
Processor speed limited at 0.4 Ghz
How can saying a song's name be a copyright violation?
Why was the shrink from 8″ made only to 5.25″ and not smaller (4″ or less)
What reasons are there for a Capitalist to oppose a 100% inheritance tax?
How does having to sign to support someone for elections fit with having a secret ballot?
Is this draw by repetition?
Description list Formatting using enumitem
One verb to replace 'be a member of' a club
How to add frame around section using titlesec?
How do conventional missiles fly?
tikz grid without top edge
TikZ (finite) grid with character in each cellLaTeX equivalent of ConTeXt buffersHow to define the default vertical distance between nodes?Numerical conditional within tikz keys?TikZ/ERD: node (=Entity) label on the insideWhy do I get an extra white page before my TikZ picture?TikZ: Drawing an arc from an intersection to an intersectionHow to prevent rounded and duplicated tick labels in pgfplots with fixed precision?Drawing rectilinear curves in Tikz, aka an Etch-a-Sketch drawingLine up nested tikz enviroments or how to get rid of themHow to draw a square and its diagonals with arrows?
In this code from TikZ (finite) grid with character in each cell
documentclassarticle
usepackagetikz
usetikzlibrarymatrix
begindocument
begintikzpicture
draw[step=0.5cm,color=gray] (-1,-1) grid (1,1);
matrix[matrix of nodes,nodes=inner sep=0pt,text width=.5cm,align=center,minimum height=.5cm]
A & B & C & D \
E & F & & H \
I & J & K & L \
M & N & O & P\;
endtikzpicture
enddocument
I would like to delete the top and left edges of the grid.
I have found solutions using node
s but much prefer this one with a matrix
.
tikz-pgf
add a comment |
In this code from TikZ (finite) grid with character in each cell
documentclassarticle
usepackagetikz
usetikzlibrarymatrix
begindocument
begintikzpicture
draw[step=0.5cm,color=gray] (-1,-1) grid (1,1);
matrix[matrix of nodes,nodes=inner sep=0pt,text width=.5cm,align=center,minimum height=.5cm]
A & B & C & D \
E & F & & H \
I & J & K & L \
M & N & O & P\;
endtikzpicture
enddocument
I would like to delete the top and left edges of the grid.
I have found solutions using node
s but much prefer this one with a matrix
.
tikz-pgf
Off topic: You have a very nice reputation number :)
– JouleV
Mar 25 at 13:35
@JouleV Indeed, It won't survive any votes on this question.
– Ethan Bolker
Mar 25 at 13:36
add a comment |
In this code from TikZ (finite) grid with character in each cell
documentclassarticle
usepackagetikz
usetikzlibrarymatrix
begindocument
begintikzpicture
draw[step=0.5cm,color=gray] (-1,-1) grid (1,1);
matrix[matrix of nodes,nodes=inner sep=0pt,text width=.5cm,align=center,minimum height=.5cm]
A & B & C & D \
E & F & & H \
I & J & K & L \
M & N & O & P\;
endtikzpicture
enddocument
I would like to delete the top and left edges of the grid.
I have found solutions using node
s but much prefer this one with a matrix
.
tikz-pgf
In this code from TikZ (finite) grid with character in each cell
documentclassarticle
usepackagetikz
usetikzlibrarymatrix
begindocument
begintikzpicture
draw[step=0.5cm,color=gray] (-1,-1) grid (1,1);
matrix[matrix of nodes,nodes=inner sep=0pt,text width=.5cm,align=center,minimum height=.5cm]
A & B & C & D \
E & F & & H \
I & J & K & L \
M & N & O & P\;
endtikzpicture
enddocument
I would like to delete the top and left edges of the grid.
I have found solutions using node
s but much prefer this one with a matrix
.
tikz-pgf
tikz-pgf
asked Mar 25 at 13:31
Ethan BolkerEthan Bolker
6,69832453
6,69832453
Off topic: You have a very nice reputation number :)
– JouleV
Mar 25 at 13:35
@JouleV Indeed, It won't survive any votes on this question.
– Ethan Bolker
Mar 25 at 13:36
add a comment |
Off topic: You have a very nice reputation number :)
– JouleV
Mar 25 at 13:35
@JouleV Indeed, It won't survive any votes on this question.
– Ethan Bolker
Mar 25 at 13:36
Off topic: You have a very nice reputation number :)
– JouleV
Mar 25 at 13:35
Off topic: You have a very nice reputation number :)
– JouleV
Mar 25 at 13:35
@JouleV Indeed, It won't survive any votes on this question.
– Ethan Bolker
Mar 25 at 13:36
@JouleV Indeed, It won't survive any votes on this question.
– Ethan Bolker
Mar 25 at 13:36
add a comment |
2 Answers
2
active
oldest
votes
We can use foreach
:
documentclass[tikz]standalone
usetikzlibrarymatrix
begindocument
begintikzpicture
%draw[step=0.5cm,color=gray] (-1,-1) grid (1,1);
foreach i in -0.5,0,0.5,1
draw[gray] (-1,-i)--(1,-i);
draw[gray] (i,-1)--(i,1);
matrix[matrix of nodes,nodes=inner sep=0pt,text width=.5cm,align=center,minimum height=.5cm]
A & B & C & D \
E & F & & H \
I & J & K & L \
M & N & O & P\;
endtikzpicture
enddocument
Honestly I don't think nodes or matrices have any thing to do here.
This approach is based on marmot's creative way, which is nicer and more tricky:
documentclass[tikz]standalone
usetikzlibrarymatrix
begindocument
begintikzpicture
draw[step=0.5cm,color=gray] (-1cm+0.2pt,-1) grid (1cm,1cm-0.2pt);
matrix[matrix of nodes,nodes=inner sep=0pt,text width=.5cm,align=center,minimum height=.5cm]
A & B & C & D \
E & F & & H \
I & J & K & L \
M & N & O & P\;
endtikzpicture
enddocument
1
Thanks. There is a "matrix" in the code. Other answers to my original question used nodes.
– Ethan Bolker
Mar 25 at 13:46
@EthanBolker No problem. You are welcome ;)
– JouleV
Mar 25 at 13:47
Maybe mention alsodraw[step=0.5cm,color=gray] (-0.99,-1) grid (1,0.99);
which is shorter and gives (for all practical purposes) the same output.
– marmot
Mar 25 at 15:15
@marmot Ohh your way is wonderfully creative :)) I did not even think of that. However they are not mathematically correct.
– JouleV
Mar 25 at 15:17
@JouleV What do you mean by "not mathematically correct"? It is as correct as a truncated grid can be.
– marmot
Mar 25 at 15:18
|
show 4 more comments
Another solution. It draws the grid with a matrix
of drawn
nodes. After that, left and top border are deleted with a white supperposed line.
documentclass[tikz,border=2mm]standalone
usetikzlibrarymatrix
begindocument
begintikzpicture
matrix[matrix of nodes,nodes=draw=gray, anchor=center, minimum size=.6cm, column sep=-pgflinewidth, row sep=-pgflinewidth] (A)
A & B & C & D \
E & F & & H \
I & J & K & L \
M & N & O & P\;
draw[white] ([xshift=.5pgflinewidth]A-4-1.south west)|-([yshift=-.5pgflinewidth]A-1-4.north east);
endtikzpicture
enddocument
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "85"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f481347%2ftikz-grid-without-top-edge%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
We can use foreach
:
documentclass[tikz]standalone
usetikzlibrarymatrix
begindocument
begintikzpicture
%draw[step=0.5cm,color=gray] (-1,-1) grid (1,1);
foreach i in -0.5,0,0.5,1
draw[gray] (-1,-i)--(1,-i);
draw[gray] (i,-1)--(i,1);
matrix[matrix of nodes,nodes=inner sep=0pt,text width=.5cm,align=center,minimum height=.5cm]
A & B & C & D \
E & F & & H \
I & J & K & L \
M & N & O & P\;
endtikzpicture
enddocument
Honestly I don't think nodes or matrices have any thing to do here.
This approach is based on marmot's creative way, which is nicer and more tricky:
documentclass[tikz]standalone
usetikzlibrarymatrix
begindocument
begintikzpicture
draw[step=0.5cm,color=gray] (-1cm+0.2pt,-1) grid (1cm,1cm-0.2pt);
matrix[matrix of nodes,nodes=inner sep=0pt,text width=.5cm,align=center,minimum height=.5cm]
A & B & C & D \
E & F & & H \
I & J & K & L \
M & N & O & P\;
endtikzpicture
enddocument
1
Thanks. There is a "matrix" in the code. Other answers to my original question used nodes.
– Ethan Bolker
Mar 25 at 13:46
@EthanBolker No problem. You are welcome ;)
– JouleV
Mar 25 at 13:47
Maybe mention alsodraw[step=0.5cm,color=gray] (-0.99,-1) grid (1,0.99);
which is shorter and gives (for all practical purposes) the same output.
– marmot
Mar 25 at 15:15
@marmot Ohh your way is wonderfully creative :)) I did not even think of that. However they are not mathematically correct.
– JouleV
Mar 25 at 15:17
@JouleV What do you mean by "not mathematically correct"? It is as correct as a truncated grid can be.
– marmot
Mar 25 at 15:18
|
show 4 more comments
We can use foreach
:
documentclass[tikz]standalone
usetikzlibrarymatrix
begindocument
begintikzpicture
%draw[step=0.5cm,color=gray] (-1,-1) grid (1,1);
foreach i in -0.5,0,0.5,1
draw[gray] (-1,-i)--(1,-i);
draw[gray] (i,-1)--(i,1);
matrix[matrix of nodes,nodes=inner sep=0pt,text width=.5cm,align=center,minimum height=.5cm]
A & B & C & D \
E & F & & H \
I & J & K & L \
M & N & O & P\;
endtikzpicture
enddocument
Honestly I don't think nodes or matrices have any thing to do here.
This approach is based on marmot's creative way, which is nicer and more tricky:
documentclass[tikz]standalone
usetikzlibrarymatrix
begindocument
begintikzpicture
draw[step=0.5cm,color=gray] (-1cm+0.2pt,-1) grid (1cm,1cm-0.2pt);
matrix[matrix of nodes,nodes=inner sep=0pt,text width=.5cm,align=center,minimum height=.5cm]
A & B & C & D \
E & F & & H \
I & J & K & L \
M & N & O & P\;
endtikzpicture
enddocument
1
Thanks. There is a "matrix" in the code. Other answers to my original question used nodes.
– Ethan Bolker
Mar 25 at 13:46
@EthanBolker No problem. You are welcome ;)
– JouleV
Mar 25 at 13:47
Maybe mention alsodraw[step=0.5cm,color=gray] (-0.99,-1) grid (1,0.99);
which is shorter and gives (for all practical purposes) the same output.
– marmot
Mar 25 at 15:15
@marmot Ohh your way is wonderfully creative :)) I did not even think of that. However they are not mathematically correct.
– JouleV
Mar 25 at 15:17
@JouleV What do you mean by "not mathematically correct"? It is as correct as a truncated grid can be.
– marmot
Mar 25 at 15:18
|
show 4 more comments
We can use foreach
:
documentclass[tikz]standalone
usetikzlibrarymatrix
begindocument
begintikzpicture
%draw[step=0.5cm,color=gray] (-1,-1) grid (1,1);
foreach i in -0.5,0,0.5,1
draw[gray] (-1,-i)--(1,-i);
draw[gray] (i,-1)--(i,1);
matrix[matrix of nodes,nodes=inner sep=0pt,text width=.5cm,align=center,minimum height=.5cm]
A & B & C & D \
E & F & & H \
I & J & K & L \
M & N & O & P\;
endtikzpicture
enddocument
Honestly I don't think nodes or matrices have any thing to do here.
This approach is based on marmot's creative way, which is nicer and more tricky:
documentclass[tikz]standalone
usetikzlibrarymatrix
begindocument
begintikzpicture
draw[step=0.5cm,color=gray] (-1cm+0.2pt,-1) grid (1cm,1cm-0.2pt);
matrix[matrix of nodes,nodes=inner sep=0pt,text width=.5cm,align=center,minimum height=.5cm]
A & B & C & D \
E & F & & H \
I & J & K & L \
M & N & O & P\;
endtikzpicture
enddocument
We can use foreach
:
documentclass[tikz]standalone
usetikzlibrarymatrix
begindocument
begintikzpicture
%draw[step=0.5cm,color=gray] (-1,-1) grid (1,1);
foreach i in -0.5,0,0.5,1
draw[gray] (-1,-i)--(1,-i);
draw[gray] (i,-1)--(i,1);
matrix[matrix of nodes,nodes=inner sep=0pt,text width=.5cm,align=center,minimum height=.5cm]
A & B & C & D \
E & F & & H \
I & J & K & L \
M & N & O & P\;
endtikzpicture
enddocument
Honestly I don't think nodes or matrices have any thing to do here.
This approach is based on marmot's creative way, which is nicer and more tricky:
documentclass[tikz]standalone
usetikzlibrarymatrix
begindocument
begintikzpicture
draw[step=0.5cm,color=gray] (-1cm+0.2pt,-1) grid (1cm,1cm-0.2pt);
matrix[matrix of nodes,nodes=inner sep=0pt,text width=.5cm,align=center,minimum height=.5cm]
A & B & C & D \
E & F & & H \
I & J & K & L \
M & N & O & P\;
endtikzpicture
enddocument
edited Mar 25 at 15:25
answered Mar 25 at 13:39
JouleVJouleV
10.1k22558
10.1k22558
1
Thanks. There is a "matrix" in the code. Other answers to my original question used nodes.
– Ethan Bolker
Mar 25 at 13:46
@EthanBolker No problem. You are welcome ;)
– JouleV
Mar 25 at 13:47
Maybe mention alsodraw[step=0.5cm,color=gray] (-0.99,-1) grid (1,0.99);
which is shorter and gives (for all practical purposes) the same output.
– marmot
Mar 25 at 15:15
@marmot Ohh your way is wonderfully creative :)) I did not even think of that. However they are not mathematically correct.
– JouleV
Mar 25 at 15:17
@JouleV What do you mean by "not mathematically correct"? It is as correct as a truncated grid can be.
– marmot
Mar 25 at 15:18
|
show 4 more comments
1
Thanks. There is a "matrix" in the code. Other answers to my original question used nodes.
– Ethan Bolker
Mar 25 at 13:46
@EthanBolker No problem. You are welcome ;)
– JouleV
Mar 25 at 13:47
Maybe mention alsodraw[step=0.5cm,color=gray] (-0.99,-1) grid (1,0.99);
which is shorter and gives (for all practical purposes) the same output.
– marmot
Mar 25 at 15:15
@marmot Ohh your way is wonderfully creative :)) I did not even think of that. However they are not mathematically correct.
– JouleV
Mar 25 at 15:17
@JouleV What do you mean by "not mathematically correct"? It is as correct as a truncated grid can be.
– marmot
Mar 25 at 15:18
1
1
Thanks. There is a "matrix" in the code. Other answers to my original question used nodes.
– Ethan Bolker
Mar 25 at 13:46
Thanks. There is a "matrix" in the code. Other answers to my original question used nodes.
– Ethan Bolker
Mar 25 at 13:46
@EthanBolker No problem. You are welcome ;)
– JouleV
Mar 25 at 13:47
@EthanBolker No problem. You are welcome ;)
– JouleV
Mar 25 at 13:47
Maybe mention also
draw[step=0.5cm,color=gray] (-0.99,-1) grid (1,0.99);
which is shorter and gives (for all practical purposes) the same output.– marmot
Mar 25 at 15:15
Maybe mention also
draw[step=0.5cm,color=gray] (-0.99,-1) grid (1,0.99);
which is shorter and gives (for all practical purposes) the same output.– marmot
Mar 25 at 15:15
@marmot Ohh your way is wonderfully creative :)) I did not even think of that. However they are not mathematically correct.
– JouleV
Mar 25 at 15:17
@marmot Ohh your way is wonderfully creative :)) I did not even think of that. However they are not mathematically correct.
– JouleV
Mar 25 at 15:17
@JouleV What do you mean by "not mathematically correct"? It is as correct as a truncated grid can be.
– marmot
Mar 25 at 15:18
@JouleV What do you mean by "not mathematically correct"? It is as correct as a truncated grid can be.
– marmot
Mar 25 at 15:18
|
show 4 more comments
Another solution. It draws the grid with a matrix
of drawn
nodes. After that, left and top border are deleted with a white supperposed line.
documentclass[tikz,border=2mm]standalone
usetikzlibrarymatrix
begindocument
begintikzpicture
matrix[matrix of nodes,nodes=draw=gray, anchor=center, minimum size=.6cm, column sep=-pgflinewidth, row sep=-pgflinewidth] (A)
A & B & C & D \
E & F & & H \
I & J & K & L \
M & N & O & P\;
draw[white] ([xshift=.5pgflinewidth]A-4-1.south west)|-([yshift=-.5pgflinewidth]A-1-4.north east);
endtikzpicture
enddocument
add a comment |
Another solution. It draws the grid with a matrix
of drawn
nodes. After that, left and top border are deleted with a white supperposed line.
documentclass[tikz,border=2mm]standalone
usetikzlibrarymatrix
begindocument
begintikzpicture
matrix[matrix of nodes,nodes=draw=gray, anchor=center, minimum size=.6cm, column sep=-pgflinewidth, row sep=-pgflinewidth] (A)
A & B & C & D \
E & F & & H \
I & J & K & L \
M & N & O & P\;
draw[white] ([xshift=.5pgflinewidth]A-4-1.south west)|-([yshift=-.5pgflinewidth]A-1-4.north east);
endtikzpicture
enddocument
add a comment |
Another solution. It draws the grid with a matrix
of drawn
nodes. After that, left and top border are deleted with a white supperposed line.
documentclass[tikz,border=2mm]standalone
usetikzlibrarymatrix
begindocument
begintikzpicture
matrix[matrix of nodes,nodes=draw=gray, anchor=center, minimum size=.6cm, column sep=-pgflinewidth, row sep=-pgflinewidth] (A)
A & B & C & D \
E & F & & H \
I & J & K & L \
M & N & O & P\;
draw[white] ([xshift=.5pgflinewidth]A-4-1.south west)|-([yshift=-.5pgflinewidth]A-1-4.north east);
endtikzpicture
enddocument
Another solution. It draws the grid with a matrix
of drawn
nodes. After that, left and top border are deleted with a white supperposed line.
documentclass[tikz,border=2mm]standalone
usetikzlibrarymatrix
begindocument
begintikzpicture
matrix[matrix of nodes,nodes=draw=gray, anchor=center, minimum size=.6cm, column sep=-pgflinewidth, row sep=-pgflinewidth] (A)
A & B & C & D \
E & F & & H \
I & J & K & L \
M & N & O & P\;
draw[white] ([xshift=.5pgflinewidth]A-4-1.south west)|-([yshift=-.5pgflinewidth]A-1-4.north east);
endtikzpicture
enddocument
answered Mar 25 at 16:03
IgnasiIgnasi
95.6k4175319
95.6k4175319
add a comment |
add a comment |
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f481347%2ftikz-grid-without-top-edge%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Off topic: You have a very nice reputation number :)
– JouleV
Mar 25 at 13:35
@JouleV Indeed, It won't survive any votes on this question.
– Ethan Bolker
Mar 25 at 13:36