在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):walmes/Tikz开源软件地址(OpenSource Url):https://github.com/walmes/Tikz开源编程语言(OpenSource Language):R 64.2%开源软件介绍(OpenSource Introduction):
This is my collection, or gallery, of Tikz Art. The official Tikz Gallery is on TeXample.net. A interesting exposition of Tikz features is done in http://tug.ctan.org/info/visualtikz/VisualTikZ.pdf. The official manual is available at http://linorg.usp.br/CTAN/graphics/pgf/base/doc/pgfmanual.pdf. There are 298 Tikz figures in this gallery. Most of them were done to teach statistics, inspired by content on the web or done from the scratch. Also, a lot were caught in the web and copied with few modifications (I run tests on it). I use ktikz editor to edit these Tikz files. This repository is maintained in to Git Version Control and is hosted on GitHub. If you want to reproduce these figures, do not forget of seeing the corresponding preamble that list all tikz libraries used: TIKZ_PREAMBLE.pgs. The figures are in file file order. A page with all figures displayed in on http://www.leg.ufpr.br/~walmes/Tikz/ (updated less frequently). Some useful tutorials or galleries:
\begin{tikzpicture}
% \fill[red] (0, 0) circle (1pt);
% \draw (0, 0) --
% ++(0.375, 0) --
% ++(60:2) --
% ++(-0.5, 0) --
% ++(-120:0.5) --
% ++(-1.25, 0) --
% ++(120:0.5) --
% ++(-0.5, 0) --
% ++(-60:2) --
% cycle;
\begin{scope}
\foreach \angle in {0, 60, ..., 300} {
\begin{scope}[rotate = \angle, shift = {(0, 1)}]
\draw[draw = none, fill = green!40!black]
(0, 0) --
++(0.375, 0) --
++(60:2) --
++(-0.5, 0) --
++(-120:0.5) --
++(-1.25, 0) --
++(120:0.5) --
++(-0.5, 0) --
++(-60:2) --
cycle;
\end{scope}
}
\end{scope}
\begin{scope}[yshift = 0cm, xshift = 5.5cm, scale = 0.5]
\foreach \angle in {0, 60, 120} {
\begin{scope}[rotate = \angle, shift = {(0, 1)}]
\draw[draw = none, fill = green!40!black]
(0, 0) --
++(0.375, 0) --
++(60:2) --
++(-0.5, 0) --
++(-120:0.5) --
++(-1.25, 0) --
++(120:0.5) --
++(-0.5, 0) --
++(-60:2) --
cycle;
\end{scope}
}
\begin{scope}[xshift = 2cm]
\foreach \angle in {180, 240, 300} {
\begin{scope}[rotate = \angle, shift = {(0, 1)}]
\draw[draw = none, fill = green!40!black]
(0, 0) --
++(0.375, 0) --
++(60:2) --
++(-0.5, 0) --
++(-120:0.5) --
++(-1.25, 0) --
++(120:0.5) --
++(-0.5, 0) --
++(-60:2) --
cycle;
\end{scope}
}
\end{scope}
\node[color = green!40!black] at (0.75, 0.25) {\huge\it PET};
\node[color = green!40!black] at (0.95, -0.65) {\it Agronomia};
\node[color = green!40!black] at (0.2, -1.35) {\it UFGD};
\end{scope}
\end{tikzpicture} \begin{tikzpicture}[%
auto, > = stealth',
node distance = 0.0ex and 2em,
pil/.style = {->},
punkt/.style = {
rectangle,
rounded corners = 3pt,
draw = black,
text width = 5.5em,
minimum height = 1.75em,
text centered}
]
\def\tratamentos{Tratamentos}
\def\respostas{Respostas}
\def\covariaveis{Covari{\' a}veis}
\def\rede{Rede de efeitos}
\begin{scope}
\node[punkt] (y1) {Respostas};
\node[punkt, above left = of y1] (t1) {\tratamentos};
\node[punkt, below left = of y1] (x1) {Covari{\' a}veis};
\path[pil] (t1) edge (y1);
\path[pil] (x1) edge (y1);
\node[fit = (t1)(x1)(y1), above, yshift = 1em] (fit1) {Rede de efeitos 1};
\end{scope}
\begin{scope}[xshift = 3.5cm]
\node[punkt] (t3) {\tratamentos};
\node[punkt, below right = of t3] (y3) {\respostas};
\node[punkt, above right = of t3] (x3) {\covariaveis};
\path[pil] (t3) edge (y3);
\path[pil] (t3) edge (x3);
\path[pil, dashed] (x3) edge (y3);
\node[fit = (t3)(x3)(y3), above, yshift = 1em] (fit3) {\rede{} 2};
\end{scope}
\begin{scope}[xshift = 3.25cm, yshift = -3cm]
\node[punkt] (y2) {\respostas};
\node[punkt, left = of y2] (t2) {\tratamentos};
\node[punkt, below left = 1.75em and -2em of y2] (x2) {\covariaveis};
\path[pil] (t2) edge (y2);
\path[pil] (x2) edge (y2);
\path[pil] (t2) edge (x2);
\node[fit = (t2)(x2)(y2), above, yshift = 1em] (fit2) {\rede{} 3};
\end{scope}
\end{tikzpicture}% %% http://tex.stackexchange.com/questions/129571/add-variable-tick-in-axis
\makeatletter
\def\markxof#1{
\pgf@process{#1}
\pgfmathparse{
\pgf@x/\pgfplotsunitxlength+
\pgfplots@data@scale@trafo@SHIFT@x)/10^\pgfplots@data@scale@trafo@EXPONENT@x}
}
\makeatother
\pgfplotsset{
every axis/.append style={font=\small},
mystyle/.style={%
clip=true,
axis x line=bottom,
axis y line=left,
xmin=1, xmax=64,
samples =32,
ymax = 1.6, ymin = -0.2}
}
\begin{tikzpicture}
\begin{axis}[
mystyle,
grid = major,
grid style={dashed},
xlabel={\emph{sample number}},
xlabel style={at={(1,-0.2)}, anchor=south},
legend cell align=left,
legend pos=outer north east]
\addplot[name path global=one,blue,mark=+,domain=1:64]
{exp(-log10(2)/(8^2/4)*(\x-32)^2)};
\addplot[name path global=two,red,domain=1:64] {0.5};
\path [name intersections={of=one and two, name=i}];
\pgfplotsextra{
\path (i-1) \pgfextra{\markxof{i-1}\xdef\mytick{\pgfmathresult}};
}
\path let \p1=($(i-1)$) in (\x1,\y1);
\draw[dashed] (i-1) -- ($(axis cs:0,-0.2)!(i-1)!(axis cs:64,-.2)$);
\legend{Sampled signal, Threshold}
\end{axis}
\begin{axis}[
mystyle,
xtick=\empty, ytick=\empty,
extra x ticks={\mytick},
extra x tick labels={$t_{step}$},
extra x tick style={
xticklabel style={yshift=-10}
}]
\end{axis}
\end{tikzpicture} \begin{tikzpicture}[%
auto, > = stealth',
node distance = 0.0ex and 3em,
pil/.style = {->},
punkt/.style = {
rectangle,
rounded corners = 3pt,
draw = black,
text width = 8em,
minimum height = 4em,
text centered}
]
\begin{scope}[xshift = 3.5cm]
\node[punkt, fill = gray!10] (t0) {Aumento da temperatura};
\node[punkt, fill = gray!10, right = of t0] (t1) {Aumento de banhistas};
\node[punkt, fill = cyan!30, below right = of t1] (t2) {Aumento das vendas de sorvete ($Y_1$)};
\node[punkt, fill = orange!30, above right = of t1] (t3) {Aumento dos ataques de tubar{\~a}o ($Y_2$)};
\path[pil] (t0) edge (t1)
(t1) edge (t2)
(t1) edge (t3);
\path[pil, <->, dashed] (t2) edge (t3);
\end{scope}
\end{tikzpicture}%
kt, below right = of t3] (y3) {\respostas};
\node[punkt, above right = of t3] (x3) {\covariaveis};
\path[pil] (t3) edge (y3);
\path[pil] (t3) edge (x3);
\path[pil, dashed] (x3) edge (y3);
\node[fit = (t3)(x3)(y3), above, yshift = 1em] (fit3) {\rede{} 2};
\end{scope}
\begin{scope}[xshift = 3.25cm, yshift = -3cm]
\node[punkt] (y2) {\respostas};
\node[punkt, left = of y2] (t2) {\tratamentos};
\node[punkt, below left = 1.75em and -2em of y2] (x2) {\covariaveis};
\path[pil] (t2) edge (y2);
\path[pil] (x2) edge (y2);
\path[pil] (t2) edge (x2);
\node[fit = (t2)(x2)(y2), above, yshift = 1em] (fit2) {\rede{} 3};
\end{scope}
\end{tikzpicture}% %% http://tex.stackexchange.com/questions/69445/using-pgfplots-why-do-i-get-undefined-control-sequence-when-trying-to-use-a-f
\begin{tikzpicture}
\begin{axis}
\foreach \x/\y in {a/-1cm, b/0cm, c/1cm} {
\edef\temp{
\noexpand\addplot+[
every error bar/.append style={xshift=\y},
every node/.style={xshift=\y},
error bars/y dir=both,
error bars/y explicit]
}
\temp
coordinates {
(0, 0) +- (0, 1)
(1, 0) +- (0, 1)
(2, 0) +- (0, 1)
};
}
\end{axis}
\end{tikzpicture} \pgfplotsset{
select row/.style={
x filter/.code={\ifnum\coordindex=#1\else\def\pgfmathresult{}\fi}
}
}
\pgfplotstableread[col sep=comma,header=false]{
1999/00,167.1
2000/1,172.5
2001/2,175
2002/3,179.3
2003/4,184.4
2004/5,188
2005/6,201.7
2006/7,208.3
2007/8,210.2
2008/9,210.5
2009/10,209.8
2010/11,207.5
2011/12,203.4
2012/13,198.2
% 2013/14(YTD),97
}\datatable
\begin{tikzpicture}[scale=0.8]
\begin{axis}[
% title=Australia's Primary Energy Consumption by sector - 2012,
ybar, bar shift=0pt,
enlarge y limits=0.1,
% xmin=0,
xtick={0,...,13},
xticklabels from table={\datatable}{0},
ymajorgrids = true,
bar width=3mm,
width=12cm, height=9cm,
xlabel={year},
ylabel={TWh},
x tick label style={font=\footnotesize,rotate=45, anchor=east},
nodes near coords align={horizontal}]
\pgfplotsinvokeforeach{0,...,13}{
\addplot table [x expr=\coordindex, select row=#1] {\datatable};
}
\node[
pin={[pin distance=1cm, pin edge={<-,>=stealth'},
shift={(-1.2cm,0.5cm)}]
Tasmania entry to NEM}] at (axis cs:5,190) {};
\end{axis}
\end{tikzpicture} \newcommand{\target}[1]{%
\foreach \r in {2.5, 2, 1.5, 1, 0.5, 0.05} {
\draw [
fill = black,
fill opacity = 0.05
] (0, 0) circle (\r cm);
}
}%
\begin{tikzpicture}[
every path/.style = {draw, > = stealth'},
nodetext/.style = {
draw, rounded corners = 2pt, fill = white,
},
labeltext/.style = {
draw, minimum width = 5.25cm, minimum height = 1.5em, fill = gray!20,
}]
\def\dist{5.5};
\begin{scope}[shift = {(0, 0)}, scale = 1.25]
\target
\foreach \x/\y in {0.825/1.414, 1.827/0.407, 1.068/0.855, 2.016/0.645, 2.131/-0.294, 0.341/1.3, 1.306/-0.008, 2.035/-0.416, 1.353/0.156, 1.163/1.409} {
\draw[fill = orange] (\x, \y) circle (2pt);
}
\node[text = cyan] (mean) at (1.4065, 0.5468) {$\times$};
\node[text = magenta] (theta) at (0, 0) {$\times$};
\path[->] (mean) to[out = 90, in = 180] ++(1, 1) node[nodetext, right] {$\text{E}(\hat{\theta)}$};
\path[->] (theta) to[out = 90, in = 0] ++(-1, 1) node[nodetext, left] {$\theta$};
\path[->] (1.163, 1.409) to[out = 90, in = 180] ++(1, 1) node[nodetext, right] {$\hat{\theta}_i$};
\node[nodetext] at (0, -3) {$\textcolor{magenta}{\text{EQM}(\hat{\theta})} = \textcolor{cyan}{\text{V}(\hat{\theta})} - \textcolor{red}{\text{B}(\hat{\theta})}^2$};
\end{scope}
\begin{scope}[shift = {(7, 0)}]
\target
\foreach \x/\y in {0.825/1.414, 1.827/0.407, 1.068/0.855, 2.016/0.645, 2.131/-0.294, 0.341/1.3, 1.306/-0.008, 2.035/-0.416, 1.353/0.156, 1.163/1.409} {
\draw[fill = orange] (\x, \y) circle (2pt);
\draw[dashed, magenta] (\x, \y) -- (0, 0);
}
\node[nodetext] at (0, -1) {$\textcolor{magenta}{\text{EQM}(\hat{\theta})} = 1/n\sum (\hat{\theta}_i - \theta)^2$};
\node[text = cyan] at (1.4065, 0.5468) {$\times$};
\node[text = magenta] at (0, 0) {$\times$};
\end{scope}
\begin{scope}[shift = {(12, 2.75)}]
\target
\foreach \x/\y in {0.825/1.414, 1.827/0.407, 1.068/0.855, 2.016/0.645, 2.131/-0.294, 0.341/1.3, 1.306/-0.008, 2.035/-0.416, 1.353/0.156, 1.163/1.409} {
\draw[fill = orange] (\x, \y) circle (2pt);
\draw[dashed, cyan] (\x, \y) -- (1.4065, 0.5468);
}
\node[nodetext] at (0, -1) {Vari{\^a}ncia: $\textcolor{cyan}{\text{V}(\hat{\theta})} = 1/n\sum (\hat{\theta}_i - \text{E}(\hat{\theta}))^2$};
\node[text = cyan] at (1.4065, 0.5468) {$\times$};
\node[text = magenta] at (0, 0) {$\times$};
\end{scope}
\begin{scope}[shift = {(12, -2.75)}]
\target
\foreach \x/\y in {0.825/1.414, 1.827/0.407, 1.068/0.855, 2.016/0.645, 2.131/-0.294, 0.341/1.3, 1.306/-0.008, 2.035/-0.416, 1.353/0.156, 1.163/1.409} {
\draw[fill = orange] (\x, \y) circle (2pt);
}
\node[nodetext] at (0, -1) {V{\'i}cio: $\textcolor{red}{\text{B}(\hat{\theta})} = \text{E}(\hat{\theta}) - \theta$};
\node[text = cyan] at (1.4065, 0.5468) {$\times$};
\node[text = magenta] at (0, 0) {$\times$};
\draw[dashed, red] (0, 0) -- (1.4065, 0.5468);
\end{scope}
\end{tikzpicture}%
% # R code.
% set.seed(123)
% n <- 10
% xy <- round(cbind(1.25 + 1 * runif(n, -1, 1),
% 0.50 + 1 * runif(n, -1, 1)),
% digits = 3)
% colMeans(xy)
% u <- apply(xy,
% MARGIN = 1,
% FUN = function(x) {
% paste(x, collapse = "/")
% })
% cat(u, sep = ", ", "\n") \begin{tikzpicture}[
every path/.style = {draw, > = stealth'},
nodetext/.style = {
rounded corners = 2pt, fill = white, minimum height = 2em
},
]
\draw (0, 0) -- ++(0, 4) node[nodetext, above] {$\theta$};
\draw (1.4065, 0) -- ++(0, 4) node[nodetext, above] {$\text{E}(\hat{\theta})$};
\def\fac{0.38}
\foreach \x [count = \y] in {0.825, 1.827, 1.068, 2.016, 2.131, 0.341, 1.306, 2.035, 1.353, 1.163} {
\draw[fill = orange] (\x, \fac*\y) circle (2pt);
\draw[dashed, yshift = 1pt, magenta] (0, \fac*\y) -- (\x, \fac*\y);
\draw[dashed, yshift = -1pt, cyan] (1.4065, \fac*\y) -- (\x, \fac*\y);
}
\path[->] (2.035, \fac*8) to[out = 90, in = 180] ++(1, 1) node[nodetext, right] {$\hat{\theta}_i$};
\node[nodetext, right] at (3, 2.5) {
$\textcolor{magenta}{\text{EQM}(\hat{\theta})} =
\textcolor{cyan}{\text{V}(\hat{\theta})} - \textcolor{red}{\text{B}(\hat{\theta})}^2$};
\path[->, yshift = 1pt, magenta] (1.827 - 0.2, \fac*2) to[out = 90, in = 180] (3, 1.2)
node[nodetext, right, text = black] {
$\textcolor{magenta}{\text{EQM}(\hat{\theta})} = (1/n) \sum (\hat{\theta}_i - \theta)^2$};
\path[->, yshift = -1pt, cyan] (1.827 - 0.2, \fac*2) to[out = -90, in = 180] (3, 0.50)
node[nodetext, right, text = black] {
Vari{\^a}ncia: $\textcolor{cyan}{\text{V}(\hat{\theta})} =
(1/n)\sum (\hat{\theta}_i - \text{E}(\hat{\theta}))^2$};
\draw[dashed, yshift = -4pt, red] (1.4065, 0) -- (0, 0);
\path[->, red] (1.4065/2, -4pt) to[out = -90, in = 180] (3, -0.3)
node[nodetext, right, text = black] {
V{\'i}cio: $\textcolor{red}{\text{B}(\hat{\theta})} = \text{E}(\hat{\theta}) - \theta$};
\end{tikzpicture}%
% # R code.
% set.seed(123)
% n <- 10
% xy <- round(cbind(1.25 + 1 * runif(n, -1, 1),
% 0.50 + 1 * runif(n, -1, 1)),
% digits = 3)
% colMeans(xy)
% u <- apply(xy,
% MARGIN = 1,
% FUN = function(x) {
% paste(x, collapse = "/")
% })
% cat(u, sep = ", ", "\n") \newcommand{\target}[1]{%
\foreach \r in {2.5, 2, 1.5, 1, 0.5, 0.05} {
\draw [
fill = black,
fill opacity = 0.15
] (0, 0) circle (\r cm);
}
}%
\newcommand{\points}[3]{%
\foreach \i in {1, 2, ..., 20} {
\pgfmathsetmacro{\xcoord}{#1 + rand * #3}
\pgfmathsetmacro{\ycoord}{#2 + rand * #3}
\draw[fill = orange] (\xcoord, \ycoord) circle (2pt);
}
}%
\newcommand{\circlevar}[3]{%
\draw[color = green] (#1, #2) circle (#3 cm);
\node[text = green] at (#1, #2) {$\times$};
}%
\def\border{
\draw (-2.65, -2.75) -- ++(5.25, 0);
\draw (2.75, 2.65) -- ++(0, -5.25);
}%
\begin{tikzpicture}[
labeltext/.style = {
draw, minimum width = 5.25cm, minimum height = 1.5em, fill = gray!20,
}]
\def\dist{5.5};
\begin{scope}[shift = {(0, 0)}]
\node[labeltext] at (0, 3) {Sem v{\'i}cio};
\node[labeltext, rotate = 90] at (-3, 0) {Alta vari{\^a}ncia};
\target
\points{0}{0}{1}
\circlevar{0}{0}{1.15}
\border
\end{scope}
\begin{scope}[shift = {(\dist, 0)}]
\node[labeltext] at (0, 3) {Com v{\'i}cio};
\target
\points{1.25}{0.50}{1}
\circlevar{1.25}{0.50}{1.15}
\border
\end{scope}
\begin{scope}[shift = {(0, -\dist)}]
\node[labeltext, rotate = 90] at (-3, 0) {Baixa vari{\^a}ncia};
\target
\points{0}{0}{0.5}
\circlevar{0}{0}{0.65}
\border
\end{scope}
\begin{scope}[shift = {(\dist, -\dist)}]
\target
\points{1.25}{0.5}{0.5}
\circlevar{1.25}{0.50}{0.65}
\border
\end{scope}
\end{tikzpicture}%cope}[shift = {(\dist, -\dist)}]
\target
\foreach \j in {1, 2, ..., 20} {
\pgfmathsetmacro{\xcoord}{1.25 + rand * 0.5}
\pgfmathsetmacro{\ycoord}{0.50 + rand * 0.5}
\draw[fill = orange] (\xcoord, \ycoord) circle (2pt);
}
\circlevar{1.25}{0.50}{0.75}
\border
\end{scope}
\end{tikzpicture}%scope}[minimum width = 1em, text width = 5.0em, text centered]
%
% \node[state] (int) at ( 90:5.5) {\emph{Intui{\c c}{\~ a}o e viabilidade}};
% \node[state] (val) at (210:5.0) {\emph{Solu{\c c}{\~ a}o e valida{\c c}{\~ a}o}};
% \node[state] (aut) at (-30:5.0) {\emph{Automa{\c c}{\~ a}o e escala}};
%
% \node (con) at (90:3) {Dom{\' i}nio de\\ conhecimento};
% \node (est) at (210:3) {Matem{\' a}tica \& Estat{\' i}stica};
% \node[text width = 7em] (hac) at (-30:3) {Habilidades de\\ computa{\c c}{\~ a}o};
%
% \node[color = red] (sof) at (30:2) {Processamento tradicional};
% \node[color = red] (pes) at (150:2) {Pesquisa tradicional};
% \node[color = red] (mac) at (-90:2) {Zona perigosa};
%
% \node (ds) at (0:0) {\large Data Science};
%
% \end{scope}
% \begin{scope}[
% every node/.style = {
% text centered,
% font = \footnotesize,
% text width = 5em
% }]
%
% \node at ( 50:3.50) {Engenharia};
% \node at (130:3.50) {Direito};
% \node at ( 70:5.00) {Biologia};
% \node at (110:5.00) {Marketing};
% \node at ( 60:4.25) {Economia};
% \node at (120:4.25) {Comunica{\c c}{\~a}o};
% \node at ( 90:4.25) {Gest{\~a}o};
%
% \node at ( 05:4.0) {Programa{\c c}{\~a}o};
% \node at (-05:4.5) {Algor{\'\i}tmos};
% \node at (-15:5.0) {Bancos de dados};
% \node at (-50:3.5) {Computa{\c c}{\~a}o em n{\'u}vem};
% \node at (-60:4.5) {Machine learning};
%
% \node at (175:4.0) {Visualiza{\c c}{\~a}o};
% \node at (185:4.5) {Otimiza{\c c}{\~a}o};
% \node at (195:5.0) {Infer{\^e}ncia estat{\'\i}stica};
% \node at (230:3.5) {An{\'a}lise multivariada};
% \node at (240:4.5) {Modelagem estat{\'\i}stica};
%
% \end{scope}
\end{tikzpicture}%% 全部评论
专题导读
上一篇:yshrsmz/BuildKonfig: BuildConfig for Kotlin Multiplatform Project发布时间:2022-07-09下一篇:LePtC/LeNote: LePtC bilingual colorful note LaTeX template发布时间:2022-07-09热门推荐
热门话题
阅读排行榜
|
请发表评论