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
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:
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
add a comment |
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:
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
add a comment |
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:
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
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:
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
tikz-pgf
asked May 26 at 17:38
user1993416user1993416
404411
404411
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
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.
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
add a comment |
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.
add a comment |
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.
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.
answered May 26 at 17:49
Marian G.Marian G.
9421210
9421210
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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