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

                    RemoteApp sporadic failureWindows 2008 RemoteAPP client disconnects within a matter of minutesWhat is the minimum version of RDP supported by Server 2012 RDS?How to configure a Remoteapp server to increase stabilityMicrosoft RemoteApp Active SessionRDWeb TS connection broken for some users post RemoteApp certificate changeRemote Desktop Licensing, RemoteAPPRDS 2012 R2 some users are not able to logon after changed date and time on Connection BrokersWhat happens during Remote Desktop logon, and is there any logging?After installing RDS on WinServer 2016 I still can only connect with two users?RD Connection via RDGW to Session host is not connecting

                    How to write a 12-bar blues melodyI-IV-V blues progressionHow to play the bridges in a standard blues progressionHow does Gdim7 fit in C# minor?question on a certain chord progressionMusicology of Melody12 bar blues, spread rhythm: alternative to 6th chord to avoid finger stretchChord progressions/ Root key/ MelodiesHow to put chords (POP-EDM) under a given lead vocal melody (starting from a good knowledge in music theory)Are there “rules” for improvising with the minor pentatonic scale over 12-bar shuffle?Confusion about blues scale and chords

                    Esgonzo ibérico Índice Descrición Distribución Hábitat Ameazas Notas Véxase tamén "Acerca dos nomes dos anfibios e réptiles galegos""Chalcides bedriagai"Chalcides bedriagai en Carrascal, L. M. Salvador, A. (Eds). Enciclopedia virtual de los vertebrados españoles. Museo Nacional de Ciencias Naturales, Madrid. España.Fotos