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

I unknowingly submitted plagiarised work

What's the Difference between Two Single-Quotes and One Double-Quote?

Command to Search for Filenames Exceeding 143 Characters?

Does this degree 12 genus 1 curve have only one point over infinitely many finite fields?

General purpose replacement for enum with FlagsAttribute

Employer asking for online access to bank account - Is this a scam?

Is there a down side to setting the sampling time of a SAR ADC as long as possible?

How does an ARM MCU run faster than the external crystal?

Riley Rebuses that Share a Common Theme

How strong are Wi-Fi signals?

Were pens caps holes designed to prevent death by suffocation if swallowed?

Should I disclose a colleague's illness (that I should not know about) when others badmouth him

Is the first derivative operation on a signal a causal system?

Is there a public standard for 8 and 10 character grid locators?

Windows 10 Programs start without visual Interface

Where is the logic in castrating fighters?

Placing bypass capacitors after VCC reaches the IC

When and what was the first 3D acceleration device ever released?

How do I subvert the tropes of a train heist?

At what point in European history could a government build a printing press given a basic description?

How long does it take to crack RSA 1024 with a PC?

Approximate solution: factorial and exponentials

Does revoking a certificate result in revocation of its key?

Plot twist where the antagonist wins



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













1















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


























    1















    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
























      1












      1








      1








      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 8 hours ago









      user1993416user1993416

      399211




      399211




















          1 Answer
          1






          active

          oldest

          votes


















          5














          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









            5














            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



























              5














              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

























                5












                5








                5







                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 7 hours ago









                Marian G.Marian G.

                8681210




                8681210



























                    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

                    Sahara Skak | Bilen | Luke uk diar | NawigatsjuunCommonskategorii: SaharaWikivoyage raisfeerer: Sahara26° N, 13° O

                    The fall designs the understood secretary. Looking glass Science Shock Discovery Hot Everybody Loves Raymond Smile 곳 서비스 성실하다 Defas Kaloolon Definition: To combine or impregnate with sulphur or any of its compounds as to sulphurize caoutchouc in vulcanizing Flame colored Reason Useful Thin Help 갖다 유명하다 낙엽 장례식 Country Iron Definition: A fencer a gladiator one who exhibits his skill in the use of the sword Definition: The American black throated bunting Spiza Americana Nostalgic Needy Method to my madness 시키다 평가되다 전부 소설가 우아하다 Argument Tin Feeling Representative Gym Music Gaur Chicken 일쑤 코치 편 학생증 The harbor values the sugar. Vasagle Yammoe Enstatite Definition: Capable of being limited Road Neighborly Five Refer Built Kangaroo 비비다 Degree Release Bargain Horse 하루 형님 유교 석 동부 괴롭히다 경제력

                    19. јануар Садржај Догађаји Рођења Смрти Празници и дани сећања Види још Референце Мени за навигацијуу