How to convert to standalone document a matrix tableTikZ: Cropping the Bounding BoxProblem in cropping the document in standalone packageCreating table using TikZ matrixMultiple tikzpictures in a standalone documentCenter in standalone makes two-page documentDocument class standalone and tikzfading/tikzfadingfrompictureStandalone tikz seems to become “squished” in documentTikz: Remove blank space around standalone document containing tikzHow empty cells in tikz table (matrix)?define tikzpicture size with standalone document class

Why ambiguous grammars are bad?

Was planting UN flag on Moon ever discussed?

Grep Match and extract

Why did the World Bank set the global poverty line at $1.90?

Confused with atmospheric pressure equals plastic balloon’s inner pressure

Was Self-modifying-code possible just using BASIC?

Suppose leased car is totalled: what are financial implications?

How to avoid typing 'git' at the begining of every Git command

Do empty drive bays need to be filled?

What plausible reason could I give for my FTL drive only working in space

What would be the way to say "just saying" in German? (Not the literal translation)

Is there a DSLR/mirorless camera with minimal options like a classic, simple SLR?

ASCII Meme Arrow Generator

What is the reason for setting flaps 1 on the ground at high temperatures?

Rail-to-rail op-amp only reaches 90% of VCC, works sometimes, not everytime

Is the Keras Embedding layer dependent on the target label?

Is it safe to remove python 2.7.15rc1 from Ubuntu 18.04?

Do you really need a KDF when you have a PRF?

A Salute to Poetry

Why are MBA programs closing in the United States?

Converting from CMYK to RGB (to work with it), then back to CMYK

Is Dumbledore a human lie detector?

Razzle Dazzle simulator

How can one's career as a reviewer be ended?



How to convert to standalone document a matrix table


TikZ: Cropping the Bounding BoxProblem in cropping the document in standalone packageCreating table using TikZ matrixMultiple tikzpictures in a standalone documentCenter in standalone makes two-page documentDocument class standalone and tikzfading/tikzfadingfrompictureStandalone tikz seems to become “squished” in documentTikz: Remove blank space around standalone document containing tikzHow empty cells in tikz table (matrix)?define tikzpicture size with standalone document class













2















I would like to generate a .pdf standalone figure of the following tikzpicture.
I have tried the common examples of standalone tikzpictures but it does not work.



documentclassarticle

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
usepackagefilecontents
usepackage[table]xcolor
usepackagepgfplotstable
usetikzlibrarycalc
% pgfplotssetcompat=1.16

% next line is to put the framebox
% usepackage[margin=1in,showframe]geometry

beginfilecontentsmatrix.cvs
0 1 1 0 1 1 0 1 0 0 0 0 0 1 1 0 0 0 1 0 0 0 1 0 1 1 0 1 1 1 1 0 0 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0 1 1
0 0 1 1 0 1 0 0 0 1 0 0 0 0 1 0 0 1 1 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 1 0 0 0 0 0 1 0 0 0 0 0 0 1 0
0 1 0 1 0 0 0 0 0 1 1 0 1 0 0 1 0 1 0 0 1 0 0 1 0 0 0 0 0 0 1 0 0 1 1 1 0 0 1 0 0 0 1 0 1 1 0 1 1 0
0 0 1 0 0 0 1 1 0 1 0 1 1 0 0 0 1 1 0 0 1 1 0 0 1 0 1 1 0 0 0 0 0 1 1 0 1 0 1 0 0 0 1 0 0 0 0 1 1 0
1 0 1 1 0 0 1 1 0 1 0 1 0 0 1 0 0 1 1 0 0 0 1 0 0 0 0 0 1 0 1 1 1 1 0 0 0 0 0 0 1 0 0 0 1 1 1 0 0 0
0 0 0 1 0 0 0 1 0 1 0 0 0 1 0 0 1 0 0 0 0 0 1 0 1 1 1 0 1 0 0 1 0 1 0 1 0 0 0 0 1 0 0 0 0 1 0 1 1 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0
1 0 1 0 0 0 1 1 1 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 1 1 0 1 1 0 1 1 1 1 1 0 1 1 0 1 0 0 1 1 1 0 0 1 1 1
endfilecontents

makeatletter
tikzset
zero color/.initial=white,
zero color/.get=zerocol,
zero color/.store in=zerocol,
one color/.initial=red,
one color/.get=onecol,
one color/.store in=onecol,
cell wd/.initial=1ex,
cell wd/.get=cellwd,
cell wd/.store in=cellwd,
cell ht/.initial=1ex,
cell ht/.get=cellht,
cell ht/.store in=cellht,
xlabels/.store in=myxlabels,
ylabels/.store in=myylabels,

newcommanddrawgrid[2][]
medskip
begintikzpicture[#1]
pgfplotstableforeachcolumn#2ascol
pgfplotstableforeachcolumnelementcolof#2ascolcnt%
ifnumcolcnt=0
fill[zerocol]($ (0,-pgfplotstablerow*cellht) + (col*cellwd,0) $) rectangle+(cellwd,cellht);
fi
ifnumcolcnt=1
fill[onecol]($ (0,-pgfplotstablerow*cellht) + (col*cellwd,0) $) rectangle+(cellwd,cellht);
fi


pgfplotstablegetrowsof#2
pgfmathtruncatemacronumrowspgfplotsretval
pgfplotstablegetcolsof#2
pgfmathtruncatemacronumcolspgfplotsretval
draw[white] (0,cellht) grid[xstep=cellwd,ystep=cellht]
(cellwd*numcols,cellht-cellht*numrows); %
foreach Z [count=Y] in myylabels
node[anchor=west,font=sffamily,scale=0.7] at
(cellwd*numcols,1.5*cellht-cellht*Y) Z;
foreach Z [count=X,evaluate=Z as CC using int(Z*100)] in myxlabels
fill[black!CC]
(-cellwd+X*cellwd,0.5*cellht-cellht*numrows)
rectangle ++ (cellwd,-cellht);
node[anchor=west,rotate=-90,font=sffamily,scale=0.7] at
(-0.5*cellwd+X*cellwd,-0.5*cellht-cellht*numrows) Z;


% next line is to put the framebox
%draw[red] (current bounding box.south west) rectangle (current bounding box.north east);
endtikzpicture
medskip

makeatother
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


begindocument

% next line is to read the data
pgfplotstablereadmatrix.cvsmatrixfile


beginfigure[!t]
centering
drawgrid[zero color=orange,
one color=violet,
cell ht=0.75em,
cell wd=0.75em,
% next line is to rotate the plot
% auto,rotate=90,transform shape,
xlabels=0.2833,0.0336,0.7766,0.0468,0.0228,0.0143,0.6877,0.0700,0.1287,0.6659,0.7123,0.0143,0.0143,0.6325,0.8049,0.7282,0.1624,0.6346,0.0564,0.0176,0.0143,0.0271,0.6463,0.7268,0.4798,0.1637,0.0297,0.3054,0.5039,0.0246,0.7140,0.3091,0.4256,0.3418,0.6493,0.0508,0.0143,0.2927,0.0291,0.6622,0.0143,0.0177,0.1610,0.1287,0.7471,0.0563,0.0143,0.3275,0.6773,0.5992,
ylabels=0.0293,0.0211,0.0165,0.0163,0.0134,0.0382,0.0150,0.8501]matrixfile
captioncaption
labelfig:label
endfigure

enddocument


which produce this:



enter image description here



I think it is because of the definition uses drawgrid command and I do not know how to adapt it to a standalone picture.










share|improve this question


























    2















    I would like to generate a .pdf standalone figure of the following tikzpicture.
    I have tried the common examples of standalone tikzpictures but it does not work.



    documentclassarticle

    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    usepackagefilecontents
    usepackage[table]xcolor
    usepackagepgfplotstable
    usetikzlibrarycalc
    % pgfplotssetcompat=1.16

    % next line is to put the framebox
    % usepackage[margin=1in,showframe]geometry

    beginfilecontentsmatrix.cvs
    0 1 1 0 1 1 0 1 0 0 0 0 0 1 1 0 0 0 1 0 0 0 1 0 1 1 0 1 1 1 1 0 0 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0 1 1
    0 0 1 1 0 1 0 0 0 1 0 0 0 0 1 0 0 1 1 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 1 0 0 0 0 0 1 0 0 0 0 0 0 1 0
    0 1 0 1 0 0 0 0 0 1 1 0 1 0 0 1 0 1 0 0 1 0 0 1 0 0 0 0 0 0 1 0 0 1 1 1 0 0 1 0 0 0 1 0 1 1 0 1 1 0
    0 0 1 0 0 0 1 1 0 1 0 1 1 0 0 0 1 1 0 0 1 1 0 0 1 0 1 1 0 0 0 0 0 1 1 0 1 0 1 0 0 0 1 0 0 0 0 1 1 0
    1 0 1 1 0 0 1 1 0 1 0 1 0 0 1 0 0 1 1 0 0 0 1 0 0 0 0 0 1 0 1 1 1 1 0 0 0 0 0 0 1 0 0 0 1 1 1 0 0 0
    0 0 0 1 0 0 0 1 0 1 0 0 0 1 0 0 1 0 0 0 0 0 1 0 1 1 1 0 1 0 0 1 0 1 0 1 0 0 0 0 1 0 0 0 0 1 0 1 1 0
    0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0
    1 0 1 0 0 0 1 1 1 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 1 1 0 1 1 0 1 1 1 1 1 0 1 1 0 1 0 0 1 1 1 0 0 1 1 1
    endfilecontents

    makeatletter
    tikzset
    zero color/.initial=white,
    zero color/.get=zerocol,
    zero color/.store in=zerocol,
    one color/.initial=red,
    one color/.get=onecol,
    one color/.store in=onecol,
    cell wd/.initial=1ex,
    cell wd/.get=cellwd,
    cell wd/.store in=cellwd,
    cell ht/.initial=1ex,
    cell ht/.get=cellht,
    cell ht/.store in=cellht,
    xlabels/.store in=myxlabels,
    ylabels/.store in=myylabels,

    newcommanddrawgrid[2][]
    medskip
    begintikzpicture[#1]
    pgfplotstableforeachcolumn#2ascol
    pgfplotstableforeachcolumnelementcolof#2ascolcnt%
    ifnumcolcnt=0
    fill[zerocol]($ (0,-pgfplotstablerow*cellht) + (col*cellwd,0) $) rectangle+(cellwd,cellht);
    fi
    ifnumcolcnt=1
    fill[onecol]($ (0,-pgfplotstablerow*cellht) + (col*cellwd,0) $) rectangle+(cellwd,cellht);
    fi


    pgfplotstablegetrowsof#2
    pgfmathtruncatemacronumrowspgfplotsretval
    pgfplotstablegetcolsof#2
    pgfmathtruncatemacronumcolspgfplotsretval
    draw[white] (0,cellht) grid[xstep=cellwd,ystep=cellht]
    (cellwd*numcols,cellht-cellht*numrows); %
    foreach Z [count=Y] in myylabels
    node[anchor=west,font=sffamily,scale=0.7] at
    (cellwd*numcols,1.5*cellht-cellht*Y) Z;
    foreach Z [count=X,evaluate=Z as CC using int(Z*100)] in myxlabels
    fill[black!CC]
    (-cellwd+X*cellwd,0.5*cellht-cellht*numrows)
    rectangle ++ (cellwd,-cellht);
    node[anchor=west,rotate=-90,font=sffamily,scale=0.7] at
    (-0.5*cellwd+X*cellwd,-0.5*cellht-cellht*numrows) Z;


    % next line is to put the framebox
    %draw[red] (current bounding box.south west) rectangle (current bounding box.north east);
    endtikzpicture
    medskip

    makeatother
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


    begindocument

    % next line is to read the data
    pgfplotstablereadmatrix.cvsmatrixfile


    beginfigure[!t]
    centering
    drawgrid[zero color=orange,
    one color=violet,
    cell ht=0.75em,
    cell wd=0.75em,
    % next line is to rotate the plot
    % auto,rotate=90,transform shape,
    xlabels=0.2833,0.0336,0.7766,0.0468,0.0228,0.0143,0.6877,0.0700,0.1287,0.6659,0.7123,0.0143,0.0143,0.6325,0.8049,0.7282,0.1624,0.6346,0.0564,0.0176,0.0143,0.0271,0.6463,0.7268,0.4798,0.1637,0.0297,0.3054,0.5039,0.0246,0.7140,0.3091,0.4256,0.3418,0.6493,0.0508,0.0143,0.2927,0.0291,0.6622,0.0143,0.0177,0.1610,0.1287,0.7471,0.0563,0.0143,0.3275,0.6773,0.5992,
    ylabels=0.0293,0.0211,0.0165,0.0163,0.0134,0.0382,0.0150,0.8501]matrixfile
    captioncaption
    labelfig:label
    endfigure

    enddocument


    which produce this:



    enter image description here



    I think it is because of the definition uses drawgrid command and I do not know how to adapt it to a standalone picture.










    share|improve this question
























      2












      2








      2








      I would like to generate a .pdf standalone figure of the following tikzpicture.
      I have tried the common examples of standalone tikzpictures but it does not work.



      documentclassarticle

      %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
      %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
      usepackagefilecontents
      usepackage[table]xcolor
      usepackagepgfplotstable
      usetikzlibrarycalc
      % pgfplotssetcompat=1.16

      % next line is to put the framebox
      % usepackage[margin=1in,showframe]geometry

      beginfilecontentsmatrix.cvs
      0 1 1 0 1 1 0 1 0 0 0 0 0 1 1 0 0 0 1 0 0 0 1 0 1 1 0 1 1 1 1 0 0 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0 1 1
      0 0 1 1 0 1 0 0 0 1 0 0 0 0 1 0 0 1 1 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 1 0 0 0 0 0 1 0 0 0 0 0 0 1 0
      0 1 0 1 0 0 0 0 0 1 1 0 1 0 0 1 0 1 0 0 1 0 0 1 0 0 0 0 0 0 1 0 0 1 1 1 0 0 1 0 0 0 1 0 1 1 0 1 1 0
      0 0 1 0 0 0 1 1 0 1 0 1 1 0 0 0 1 1 0 0 1 1 0 0 1 0 1 1 0 0 0 0 0 1 1 0 1 0 1 0 0 0 1 0 0 0 0 1 1 0
      1 0 1 1 0 0 1 1 0 1 0 1 0 0 1 0 0 1 1 0 0 0 1 0 0 0 0 0 1 0 1 1 1 1 0 0 0 0 0 0 1 0 0 0 1 1 1 0 0 0
      0 0 0 1 0 0 0 1 0 1 0 0 0 1 0 0 1 0 0 0 0 0 1 0 1 1 1 0 1 0 0 1 0 1 0 1 0 0 0 0 1 0 0 0 0 1 0 1 1 0
      0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0
      1 0 1 0 0 0 1 1 1 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 1 1 0 1 1 0 1 1 1 1 1 0 1 1 0 1 0 0 1 1 1 0 0 1 1 1
      endfilecontents

      makeatletter
      tikzset
      zero color/.initial=white,
      zero color/.get=zerocol,
      zero color/.store in=zerocol,
      one color/.initial=red,
      one color/.get=onecol,
      one color/.store in=onecol,
      cell wd/.initial=1ex,
      cell wd/.get=cellwd,
      cell wd/.store in=cellwd,
      cell ht/.initial=1ex,
      cell ht/.get=cellht,
      cell ht/.store in=cellht,
      xlabels/.store in=myxlabels,
      ylabels/.store in=myylabels,

      newcommanddrawgrid[2][]
      medskip
      begintikzpicture[#1]
      pgfplotstableforeachcolumn#2ascol
      pgfplotstableforeachcolumnelementcolof#2ascolcnt%
      ifnumcolcnt=0
      fill[zerocol]($ (0,-pgfplotstablerow*cellht) + (col*cellwd,0) $) rectangle+(cellwd,cellht);
      fi
      ifnumcolcnt=1
      fill[onecol]($ (0,-pgfplotstablerow*cellht) + (col*cellwd,0) $) rectangle+(cellwd,cellht);
      fi


      pgfplotstablegetrowsof#2
      pgfmathtruncatemacronumrowspgfplotsretval
      pgfplotstablegetcolsof#2
      pgfmathtruncatemacronumcolspgfplotsretval
      draw[white] (0,cellht) grid[xstep=cellwd,ystep=cellht]
      (cellwd*numcols,cellht-cellht*numrows); %
      foreach Z [count=Y] in myylabels
      node[anchor=west,font=sffamily,scale=0.7] at
      (cellwd*numcols,1.5*cellht-cellht*Y) Z;
      foreach Z [count=X,evaluate=Z as CC using int(Z*100)] in myxlabels
      fill[black!CC]
      (-cellwd+X*cellwd,0.5*cellht-cellht*numrows)
      rectangle ++ (cellwd,-cellht);
      node[anchor=west,rotate=-90,font=sffamily,scale=0.7] at
      (-0.5*cellwd+X*cellwd,-0.5*cellht-cellht*numrows) Z;


      % next line is to put the framebox
      %draw[red] (current bounding box.south west) rectangle (current bounding box.north east);
      endtikzpicture
      medskip

      makeatother
      %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
      %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


      begindocument

      % next line is to read the data
      pgfplotstablereadmatrix.cvsmatrixfile


      beginfigure[!t]
      centering
      drawgrid[zero color=orange,
      one color=violet,
      cell ht=0.75em,
      cell wd=0.75em,
      % next line is to rotate the plot
      % auto,rotate=90,transform shape,
      xlabels=0.2833,0.0336,0.7766,0.0468,0.0228,0.0143,0.6877,0.0700,0.1287,0.6659,0.7123,0.0143,0.0143,0.6325,0.8049,0.7282,0.1624,0.6346,0.0564,0.0176,0.0143,0.0271,0.6463,0.7268,0.4798,0.1637,0.0297,0.3054,0.5039,0.0246,0.7140,0.3091,0.4256,0.3418,0.6493,0.0508,0.0143,0.2927,0.0291,0.6622,0.0143,0.0177,0.1610,0.1287,0.7471,0.0563,0.0143,0.3275,0.6773,0.5992,
      ylabels=0.0293,0.0211,0.0165,0.0163,0.0134,0.0382,0.0150,0.8501]matrixfile
      captioncaption
      labelfig:label
      endfigure

      enddocument


      which produce this:



      enter image description here



      I think it is because of the definition uses drawgrid command and I do not know how to adapt it to a standalone picture.










      share|improve this question














      I would like to generate a .pdf standalone figure of the following tikzpicture.
      I have tried the common examples of standalone tikzpictures but it does not work.



      documentclassarticle

      %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
      %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
      usepackagefilecontents
      usepackage[table]xcolor
      usepackagepgfplotstable
      usetikzlibrarycalc
      % pgfplotssetcompat=1.16

      % next line is to put the framebox
      % usepackage[margin=1in,showframe]geometry

      beginfilecontentsmatrix.cvs
      0 1 1 0 1 1 0 1 0 0 0 0 0 1 1 0 0 0 1 0 0 0 1 0 1 1 0 1 1 1 1 0 0 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0 1 1
      0 0 1 1 0 1 0 0 0 1 0 0 0 0 1 0 0 1 1 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 1 0 0 0 0 0 1 0 0 0 0 0 0 1 0
      0 1 0 1 0 0 0 0 0 1 1 0 1 0 0 1 0 1 0 0 1 0 0 1 0 0 0 0 0 0 1 0 0 1 1 1 0 0 1 0 0 0 1 0 1 1 0 1 1 0
      0 0 1 0 0 0 1 1 0 1 0 1 1 0 0 0 1 1 0 0 1 1 0 0 1 0 1 1 0 0 0 0 0 1 1 0 1 0 1 0 0 0 1 0 0 0 0 1 1 0
      1 0 1 1 0 0 1 1 0 1 0 1 0 0 1 0 0 1 1 0 0 0 1 0 0 0 0 0 1 0 1 1 1 1 0 0 0 0 0 0 1 0 0 0 1 1 1 0 0 0
      0 0 0 1 0 0 0 1 0 1 0 0 0 1 0 0 1 0 0 0 0 0 1 0 1 1 1 0 1 0 0 1 0 1 0 1 0 0 0 0 1 0 0 0 0 1 0 1 1 0
      0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0
      1 0 1 0 0 0 1 1 1 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 1 1 0 1 1 0 1 1 1 1 1 0 1 1 0 1 0 0 1 1 1 0 0 1 1 1
      endfilecontents

      makeatletter
      tikzset
      zero color/.initial=white,
      zero color/.get=zerocol,
      zero color/.store in=zerocol,
      one color/.initial=red,
      one color/.get=onecol,
      one color/.store in=onecol,
      cell wd/.initial=1ex,
      cell wd/.get=cellwd,
      cell wd/.store in=cellwd,
      cell ht/.initial=1ex,
      cell ht/.get=cellht,
      cell ht/.store in=cellht,
      xlabels/.store in=myxlabels,
      ylabels/.store in=myylabels,

      newcommanddrawgrid[2][]
      medskip
      begintikzpicture[#1]
      pgfplotstableforeachcolumn#2ascol
      pgfplotstableforeachcolumnelementcolof#2ascolcnt%
      ifnumcolcnt=0
      fill[zerocol]($ (0,-pgfplotstablerow*cellht) + (col*cellwd,0) $) rectangle+(cellwd,cellht);
      fi
      ifnumcolcnt=1
      fill[onecol]($ (0,-pgfplotstablerow*cellht) + (col*cellwd,0) $) rectangle+(cellwd,cellht);
      fi


      pgfplotstablegetrowsof#2
      pgfmathtruncatemacronumrowspgfplotsretval
      pgfplotstablegetcolsof#2
      pgfmathtruncatemacronumcolspgfplotsretval
      draw[white] (0,cellht) grid[xstep=cellwd,ystep=cellht]
      (cellwd*numcols,cellht-cellht*numrows); %
      foreach Z [count=Y] in myylabels
      node[anchor=west,font=sffamily,scale=0.7] at
      (cellwd*numcols,1.5*cellht-cellht*Y) Z;
      foreach Z [count=X,evaluate=Z as CC using int(Z*100)] in myxlabels
      fill[black!CC]
      (-cellwd+X*cellwd,0.5*cellht-cellht*numrows)
      rectangle ++ (cellwd,-cellht);
      node[anchor=west,rotate=-90,font=sffamily,scale=0.7] at
      (-0.5*cellwd+X*cellwd,-0.5*cellht-cellht*numrows) Z;


      % next line is to put the framebox
      %draw[red] (current bounding box.south west) rectangle (current bounding box.north east);
      endtikzpicture
      medskip

      makeatother
      %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
      %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


      begindocument

      % next line is to read the data
      pgfplotstablereadmatrix.cvsmatrixfile


      beginfigure[!t]
      centering
      drawgrid[zero color=orange,
      one color=violet,
      cell ht=0.75em,
      cell wd=0.75em,
      % next line is to rotate the plot
      % auto,rotate=90,transform shape,
      xlabels=0.2833,0.0336,0.7766,0.0468,0.0228,0.0143,0.6877,0.0700,0.1287,0.6659,0.7123,0.0143,0.0143,0.6325,0.8049,0.7282,0.1624,0.6346,0.0564,0.0176,0.0143,0.0271,0.6463,0.7268,0.4798,0.1637,0.0297,0.3054,0.5039,0.0246,0.7140,0.3091,0.4256,0.3418,0.6493,0.0508,0.0143,0.2927,0.0291,0.6622,0.0143,0.0177,0.1610,0.1287,0.7471,0.0563,0.0143,0.3275,0.6773,0.5992,
      ylabels=0.0293,0.0211,0.0165,0.0163,0.0134,0.0382,0.0150,0.8501]matrixfile
      captioncaption
      labelfig:label
      endfigure

      enddocument


      which produce this:



      enter image description here



      I think it is because of the definition uses drawgrid command and I do not know how to adapt it to a standalone picture.







      tikz-pgf






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked May 26 at 17:38









      user1993416user1993416

      404411




      404411




















          1 Answer
          1






          active

          oldest

          votes


















          7














          All you need to change is to delete several lines that are meaningless in standalone-class. Delete the figure environment, the caption- and label-part. Also, the centering is not necessary.






          share|improve this answer























            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
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f492750%2fhow-to-convert-to-standalone-document-a-matrix-table%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            7














            All you need to change is to delete several lines that are meaningless in standalone-class. Delete the figure environment, the caption- and label-part. Also, the centering is not necessary.






            share|improve this answer



























              7














              All you need to change is to delete several lines that are meaningless in standalone-class. Delete the figure environment, the caption- and label-part. Also, the centering is not necessary.






              share|improve this answer

























                7












                7








                7







                All you need to change is to delete several lines that are meaningless in standalone-class. Delete the figure environment, the caption- and label-part. Also, the centering is not necessary.






                share|improve this answer













                All you need to change is to delete several lines that are meaningless in standalone-class. Delete the figure environment, the caption- and label-part. Also, the centering is not necessary.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered May 26 at 17:49









                Marian G.Marian G.

                9421210




                9421210



























                    draft saved

                    draft discarded
















































                    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.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f492750%2fhow-to-convert-to-standalone-document-a-matrix-table%23new-answer', 'question_page');

                    );

                    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







                    Popular posts from this blog

                    Club Baloncesto Breogán Índice Historia | Pavillón | Nome | O Breogán na cultura popular | Xogadores | Adestradores | Presidentes | Palmarés | Historial | Líderes | Notas | Véxase tamén | Menú de navegacióncbbreogan.galCadroGuía oficial da ACB 2009-10, páxina 201Guía oficial ACB 1992, páxina 183. Editorial DB.É de 6.500 espectadores sentados axeitándose á última normativa"Estudiantes Junior, entre as mellores canteiras"o orixinalHemeroteca El Mundo Deportivo, 16 setembro de 1970, páxina 12Historia do BreogánAlfredo Pérez, o último canoneiroHistoria C.B. BreogánHemeroteca de El Mundo DeportivoJimmy Wright, norteamericano do Breogán deixará Lugo por ameazas de morteResultados de Breogán en 1986-87Resultados de Breogán en 1990-91Ficha de Velimir Perasović en acb.comResultados de Breogán en 1994-95Breogán arrasa al Barça. "El Mundo Deportivo", 27 de setembro de 1999, páxina 58CB Breogán - FC BarcelonaA FEB invita a participar nunha nova Liga EuropeaCharlie Bell na prensa estatalMáximos anotadores 2005Tempada 2005-06 : Tódolos Xogadores da Xornada""Non quero pensar nunha man negra, mais pregúntome que está a pasar""o orixinalRaúl López, orgulloso dos xogadores, presume da boa saúde económica do BreogánJulio González confirma que cesa como presidente del BreogánHomenaxe a Lisardo GómezA tempada do rexurdimento celesteEntrevista a Lisardo GómezEl COB dinamita el Pazo para forzar el quinto (69-73)Cafés Candelas, patrocinador del CB Breogán"Suso Lázare, novo presidente do Breogán"o orixinalCafés Candelas Breogán firma el mayor triunfo de la historiaEl Breogán realizará 17 homenajes por su cincuenta aniversario"O Breogán honra ao seu fundador e primeiro presidente"o orixinalMiguel Giao recibiu a homenaxe do PazoHomenaxe aos primeiros gladiadores celestesO home que nos amosa como ver o Breo co corazónTita Franco será homenaxeada polos #50anosdeBreoJulio Vila recibirá unha homenaxe in memoriam polos #50anosdeBreo"O Breogán homenaxeará aos seus aboados máis veteráns"Pechada ovación a «Capi» Sanmartín e Ricardo «Corazón de González»Homenaxe por décadas de informaciónPaco García volve ao Pazo con motivo do 50 aniversario"Resultados y clasificaciones""O Cafés Candelas Breogán, campión da Copa Princesa""O Cafés Candelas Breogán, equipo ACB"C.B. Breogán"Proxecto social"o orixinal"Centros asociados"o orixinalFicha en imdb.comMario Camus trata la recuperación del amor en 'La vieja música', su última película"Páxina web oficial""Club Baloncesto Breogán""C. B. Breogán S.A.D."eehttp://www.fegaba.com

                    Vilaño, A Laracha Índice Patrimonio | Lugares e parroquias | Véxase tamén | Menú de navegación43°14′52″N 8°36′03″O / 43.24775, -8.60070

                    Cegueira Índice Epidemioloxía | Deficiencia visual | Tipos de cegueira | Principais causas de cegueira | Tratamento | Técnicas de adaptación e axudas | Vida dos cegos | Primeiros auxilios | Crenzas respecto das persoas cegas | Crenzas das persoas cegas | O neno deficiente visual | Aspectos psicolóxicos da cegueira | Notas | Véxase tamén | Menú de navegación54.054.154.436928256blindnessDicionario da Real Academia GalegaPortal das Palabras"International Standards: Visual Standards — Aspects and Ranges of Vision Loss with Emphasis on Population Surveys.""Visual impairment and blindness""Presentan un plan para previr a cegueira"o orixinalACCDV Associació Catalana de Cecs i Disminuïts Visuals - PMFTrachoma"Effect of gene therapy on visual function in Leber's congenital amaurosis"1844137110.1056/NEJMoa0802268Cans guía - os mellores amigos dos cegosArquivadoEscola de cans guía para cegos en Mortágua, PortugalArquivado"Tecnología para ciegos y deficientes visuales. Recopilación de recursos gratuitos en la Red""Colorino""‘COL.diesis’, escuchar los sonidos del color""COL.diesis: Transforming Colour into Melody and Implementing the Result in a Colour Sensor Device"o orixinal"Sistema de desarrollo de sinestesia color-sonido para invidentes utilizando un protocolo de audio""Enseñanza táctil - geometría y color. Juegos didácticos para niños ciegos y videntes""Sistema Constanz"L'ocupació laboral dels cecs a l'Estat espanyol està pràcticament equiparada a la de les persones amb visió, entrevista amb Pedro ZuritaONCE (Organización Nacional de Cegos de España)Prevención da cegueiraDescrición de deficiencias visuais (Disc@pnet)Braillín, un boneco atractivo para calquera neno, con ou sen discapacidade, que permite familiarizarse co sistema de escritura e lectura brailleAxudas Técnicas36838ID00897494007150-90057129528256DOID:1432HP:0000618D001766C10.597.751.941.162C97109C0155020