I'm very new to latex and trying to recreate this table from word into latex but I have no idea where to even begin. Any help would be greatly appreciated table

  • I would use tikz, not data visualizaton or pgfplots. and draw the axes manually. You might be able to simplify things a bit using a tikz matrix, but you will lose about as much as you gain. Apr 18, 2018 at 20:20

1 Answer 1


The job is to functionally define the points and use the counters that automate the drawing of lines and name points, here the code using the tkz-euclide package, I think it can also be done without this package, but I use the commands that simplify the code to determine lines between points.

Here the result showing the point names to work with counts enter image description here

Here the code:

% By J. Leon V.  coded based on the BSD, MIT, Beerware licences.

    % Set limits.
        \tkzInit[xmax=14,xmin=-2,ymax=8.5, ymin=-0.5]
    %\tkzGrid[sub,color=blue!10!,subxstep=.5,subystep=.5] %HIDE CARTESIAN GRID
    %Define principal points.
    \foreach \y [count=\i] in {0, 1, 2.5, 3.5, 4.5, 6, 7}{
            %   \tkzDrawPoint[fill=red,size=10pt,](R\i) % SHOW HIDEN POINTS R
    \foreach \x [count=\i] in {2, 3.5, 5.5, 7, 8.5, 10.5, 12} {
            \foreach \y [count=\j] in {0, 1, 2.5, 3.5, 4.5, 6, 7}{
        %   \tkzLabelPoints[color=blue,opacity=.5,below](O\i\j) % SHOW REAL ID OXY
    %Define auxiliar points
        \tkzDefPoint(0,8.5){t} \tkzDefPoint(0,-.5){to}
        \tkzDefPoint(14,0){x} \tkzDefPoint(-.5,0){xo}
    %Draw all the segments
    %Draw in groups.
    \foreach \x [count=\i] in {1,...,7} {
        %Draw all the horizontal lines

        %Draw all the vertical lines
    %Draw complements.
    \tkzDrawSegments[very thick](R1,R2 R3,R5 R1,O21 O31,O51)
    \tkzDrawSegments[very thick](R1,xo R1,to)
    \tkzDrawSegments[very thick, dashed](R2,R3 R5,R6 O21,O31 O51,O61)
    \tkzDrawVectors[very thick](R6,t O71,x)

    %Label all points.
    \foreach \x [count=\i] in {0, 1, i-1, i, i+1, n-1, n} {
            \foreach \y [count=\j] in {0, 1, k-1, k, k+1, m-1, m}{
            \tkzLabelPoint[above right](O\i\j){\small $U_{\x,\y}$}
    %Label T axis
    \foreach \x [count=\i from 2 ] in {1,k-1,k,k+1,m-1} {
        %Draw all the horizontal lines
        \tkzLabelPoint[above left](R\i){ $t_{\x}$}

    \tkzLabelPoint[above left](R1){ $t_{0}=0$}
    \tkzLabelPoint[above left](R7){ $t_{m}=T$}
    %Label x axis
    \foreach \x [count=\i from 2 ] in {1,k-1,k,k+1,m-1} {
        %Draw all the horizontal lines
        \tkzLabelPoint[below](O\i1){ $t_{\x}$}
    \tkzLabelPoint[below](O11){ $X_{0}=X_{min}$}
    \tkzLabelPoint[below left](t){\large $t$}
    \tkzLabelPoint[below left](x){\large $x$}

Here the result:

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .