I am bit confused about how can i draw a table like this using tikz. Any ideas please?
[Tex/LaTex] Drawing database tables in tikz
tablestikz-pgf
Related Solutions
You have two \\
now:
... redundant user input\\
\\\hline
\end{tabularx}%
Before you had no \\
:
... redundant user input
\hline
\end{tabularx}%
which causes the mentioned error.
You need only one \\
:
... redundant user input\\
\hline
\end{tabularx}%
And then it works properly.
The reason why some lines are missing when you have two \\
is that the cells are not filled out, e.g. there are not &
in the last row. The lines are only drawn with the cells. Therefore no cells -> no lines.
More realistic amoeba with PSTricks.
First Version
Please skip this first version (as there is a small glitch) and jump to the final version.
In this version I use \psparametricplot
. After meticulously figuring out its behavior, I noticed that the last node is always included to create the closed curve. As a result, the first node and the last node are on the same radial line that make the curve has a visual defect on the curved line joining them.
I have no idea how to exclude the last node when using \psparametricplot
.
\documentclass[pstricks]{standalone}
\usepackage{pst-plot}
\psset
{
plotstyle=ccurve,
fillstyle=solid,
fillcolor=gray,
}
\begin{document}
\begin{pspicture}(-3,-3)(3,3)
\psparametricplot[plotpoints=40]{0}{360}{/R rand 1001 mod 1000 div 1.5 add def R t PtoC}
\end{pspicture}
\end{document}
Animation
\documentclass[pstricks]{standalone}
\usepackage{pst-plot}
\psset
{
plotstyle=ccurve,
fillstyle=solid,
fillcolor=gray,
}
\begin{document}
\multido{\i=4+4}{20}{%
\begin{pspicture}(-3,-3)(3,3)
\psparametricplot[plotpoints=\i]{0}{360}{/R rand 1001 mod 1000 div 1.5 add def R t PtoC}
\end{pspicture}}
\end{document}
Final version
In this version I use \curvepnodes
to produce a list of nodes. \Pnodecount
represents the index of the last element.
Therefore,
\multido{\i=0+1}{\Pnodecount}{\xdef\points{\points (P\i)}}
exludes the last node.
One advantage of using \curvepnodes
is that we don't need to calculate the angle step.
\documentclass[pstricks]{standalone}
\usepackage{pst-node,pst-plot}
\psset{fillstyle=solid,fillcolor=gray}
\def\points{}
\pstVerb{666 srand}
\def\N{25}
\begin{document}
\begin{pspicture}(-3,-3)(3,3)
\curvepnodes[plotpoints=\N]{0}{360}{rand 16 mod 15 div 1.5 add t PtoC}{P}
\multido{\i=0+1}{\Pnodecount}{\xdef\points{\points (P\i)}}
\expandafter\psccurve\points
\end{pspicture}
\end{document}
Animation
\documentclass[pstricks]{standalone}
\usepackage{pst-node,pst-plot}
\usepackage{graphicx}
\newsavebox\IBox
\savebox\IBox{\includegraphics[width=6cm]{example-grid-100x100pt}}
\psset
{
fillstyle=solid,
fillcolor=gray,
xunit=\dimexpr\wd\IBox/6,
yunit=\dimexpr\ht\IBox/6,
}
\pstVerb{666 srand}
\begin{document}
\multido{\io=15+5}{10}{%
\def\points{}%
\begin{pspicture}(-3,-3)(3,3)
\curvepnodes[plotpoints=\io]{0}{360}{rand 16 mod 15 div 1.5 add t PtoC}{P}
\multido{\ii=0+1}{\Pnodecount}{\xdef\points{\points (P\ii)}}
\begin{psclip}{\expandafter\psccurve\points}
\rput(0,0){\usebox\IBox}
\end{psclip}
\end{pspicture}}
\end{document}
Best Answer
This answer uses
positioning-plus
library,node-families
library (note that the keyText Width
is not perfect and needs to be removed for one compilation pass if one of the nodes of the node family changes),paths-ortho
library (DL 1, DL 2),matrix
library,anchor
key from another answer of mine,left delimiter
key from thematrix
library(
left delimiter=\{
will still work), andCode
Output