Awesome Latex Drawing
Drawing Bayesian networks, graphical models, tensors, technical frameworks, and illustrations in LaTeX.
Install / Use
npx skills add xinychen/awesome-latex-drawingInstalls into whichever agent you are using.
README
Awesome LaTeX drawing
<h6 align="center">Made by Xinyu Chen • :globe_with_meridians: <a href="https://xinychen.github.io">https://xinychen.github.io</a></h6>awesome-latex-drawing is a collection of 30+ academic drawing examples for using LaTeX, including Bayesian networks, function plotting, graphical models, matrix/tensor computations, and machine learning frameworks.
<br>Description
LaTeX is a high-quality typesetting system for creating academic graphics. Its popularity stems from its ability to handle complex illustrations with special symbols and mathematical equations, making it ideal for drawing detailed graphics in several scientific areas such as mathematics, physics, and computer science.
This project provides several LaTeX graphics, with examples that are easy to follow on Overleaf. If you are interested, feel free to explore and reproduce our examples on Overleaf at overleaf.com.
<br> <!-- ## Contents ### Table of Examples - **Bayesian networks** - [x] [Bayesian network of Bayesian CP factorization (BCPF)](https://github.com/xinychen/awesome-latex-drawing#example-1) - [x] [Bayesian network of Bayesian Gaussian CP (BGCP) factorization](https://github.com/xinychen/awesome-latex-drawing#example-2) - [x] [Bayesian network of Bayesian augmented tensor factorization (BATF)](https://github.com/xinychen/awesome-latex-drawing#example-3) - [x] [Bayesian network of Bayesian temporal matrix factorization (BTMF)](https://github.com/xinychen/awesome-latex-drawing#example-4) <br> - **Graphical models** - [x] [Partially observed time series matrix and tensor](https://github.com/xinychen/awesome-latex-drawing#example-5) - [x] [Matrix and tensor time series prediction in the presence of missing values](https://github.com/xinychen/awesome-latex-drawing#example-6) - [x] [Undirected and circulant graphs on the relational data samples with certain degrees](https://github.com/xinychen/awesome-latex-drawing#example-7) - [x] [Laplacian convolutional time series modeling](https://github.com/xinychen/awesome-latex-drawing#example-8) <br> - **`pgfplots` function plotting** - [x] [PDF and CDF functions of Erlang distribution](https://github.com/xinychen/awesome-latex-drawing#example-9) - [x] [PDF of normal distribution with different means and variances](https://github.com/xinychen/awesome-latex-drawing#example-10) - [x] [(Joint) PDF functions of Lognormal distributions](https://github.com/xinychen/awesome-latex-drawing#example-11) - [x] [Iterative process of conjugate gradient for solving a system of linear equations](https://github.com/xinychen/awesome-latex-drawing#example-12) - [x] [Random and non-random missing patterns](https://github.com/xinychen/awesome-latex-drawing#example-13) - [x] [Sine and Cosine functions](https://github.com/xinychen/awesome-latex-drawing#example-14) - [x] [Mechanism of time series forecasting](https://github.com/xinychen/awesome-latex-drawing#example-15) <br> - **`tikz` for matrix structure** - [x] [Graphical illustration of the multivariate time series forecasting problem](https://github.com/xinychen/awesome-latex-drawing#example-16) - [x] [Graphical illustration of the temporal matrix factorization](https://github.com/xinychen/awesome-latex-drawing#example-17) - [x] [Graphical illustration of the rolling time series forecasting with temporal matrix factorization](https://github.com/xinychen/awesome-latex-drawing#example-18) <br> - **`tikz-3dplot` for tensor structure** - [x] [Graphical illustration for the (origin, destination, time slot) tensor](https://github.com/xinychen/awesome-latex-drawing#example-19) - [x] [Graphical illustration of the classical CP tensor factorization on a third-order tensor](https://github.com/xinychen/awesome-latex-drawing#example-20) - [x] [Graphical illustration of augmented tensor factorization (AuTF) model](https://github.com/xinychen/awesome-latex-drawing#example-21) - [x] [Graphical illustration of tensor completion task and its framework](https://github.com/xinychen/awesome-latex-drawing#example-22) - [x] [Graphical illustration of low-rank autoregressive tensor completion model](https://github.com/xinychen/awesome-latex-drawing#example-23) - [x] [Graphical illustration of singular value thresholding process of the tensor data with unitary transform](https://github.com/xinychen/awesome-latex-drawing#example-24) - [x] [Graphical illustration of low-rank tensor completion model](https://github.com/xinychen/awesome-latex-drawing#example-25) - [x] [Graphical illustration of low-rank tensor regression model](https://github.com/xinychen/awesome-latex-drawing#example-26) <br> -->Gallery
Looking for some good LaTeX drawing examples? Here are 30+ graphics for showing how to draw in LaTaX.
Bayesian Networks
LaTeX provides some powerful domain-specific packages and tools like tikz to enable flexible graphical models. Bayesian networks represent a family of graphical models consisting of variables (usually denoted by nodes) and dependency relationships (usually denoted by arrows). Fortunately, tikz has a specific library for drawing Bayesian networks and directed factor graphs.
Another toolbox in Python: https://docs.daft-pgm.org/en/latest/
Bayesian Tensor Factorization
[Example 1]
This example is from the following paper:
<a href="https://github.com/xinychen/awesome-latex-drawing/blob/master/BayesNet/BCPF.tex"> <img src="BayesNet/BCPF.png" alt="drawing" width="280" align="right"/> </a> which shows the Bayesian network of Bayesian CP factorization (BCPF) model. To draw this Bayesian network example, there are some preliminaries to follow: <br>
- Qibin Zhao, Liqing Zhang, Andrzej Cichocki (2015). Bayesian CP factorization of incomplete tensors with automatic rank determination. IEEE Transactions on Pattern Analysis and Machine Intelligence, 37(9): 1751-1763.
preamblecodes:- define the
documentclassasstandalone, e.g.,\documentclass[border = 0.1cm]{standalone}with 0.1cm border, - use the package
tikz, i.e.,\usepackage{tikz}, and usetikzlibrary like\usetikzlibrary{bayesnet}which is an important tool for drawing Bayesian networks and directed factor graphs, - set the
tikzstyle by using the\tikzstyle{}command, - use math equation environments including
\usepackage{amsfonts, amsmath, amssymb}.
- define the
bodycodes:- use
\begin{tikzpicture} \end{tikzpicture}to start drawing, - use
\nodeto define nodes and text boxes in the Bayesian network, - use
\pathto define arrows in the Bayesian network, - use
\plateto define plates in the Bayesian network.
- use
<br>Please click on the image and check out the source code.
- Open BGCP.tex in your overleaf project, then you will see the following pictures about BGCP (Bayesian Gaussian CP decomposition) model as a Bayesian network and a directed factor graph:
[Example 2]
This example is from the following paper:
<a href="https://github.com/xinychen/awesome-latex-drawing/blob/master/BayesNet/BGCP-1.tex"> <img src="BayesNet/BGCP-1.png" alt="drawing" width="280" align="right"/> </a> which shows the Bayesian network of Bayesian Gaussian CP factorization (BGCP) model. To draw this Bayesian network example, there are some preliminaries to follow:Xinyu Chen, Zhaocheng He, Lijun Sun (2019). A Bayesian tensor decomposition approach for spatiotemporal traffic data imputation. Transportation Research Part C: Emerging Technologies, 98: 73-84.
preamblecodes:- define the
documentclassasstandalone, e.g.,\documentclass[border = 0.1cm]{standalone}with 0.1cm border, - use the package
tikz, i.e.,\usepackage{tikz}, and usetikzlibrary like\usetikzlibrary{bayesnet}which is an important tool for drawing Bayesian networks and directed factor graph, - set the
tikzstyle by using the\tikzstyle{}command, - use math equation environments including
\usepackage{amsmath, amsfonts, amssymb}.
- define the
bodycodes:- use
\begin{tikzpicture} \end{tikzpicture}to start drawing, - use
\nodeto define nodes and text boxes in the Bayesian network, - use
\pathto define arrows in the Bayesian network, - use
\plateto define plates in the Bayesian network.
- use
<br>Please click on the image and check out the source code. If you are interested in the original Bayesian network of BGCP in the paper, please check out BGCP.tex.
[Example 3]
This example is from the following paper:
<a href="https://github.com/xinychen/awesome-latex-drawing/blob/master/BayesNet/BATF.tex"> <img src="BayesNet/BATF.png" alt="drawing" width="300" align="right"/> </a> which shows the Bayesian network of Bayesian augmented tensor factorization (BATF) mXinyu Chen, Zhaocheng He, Yixian Chen, Yuhuan Lu, Jiawei Wang (2019). Missing traffic data imputation and pattern discovery with a Bayesian augmented tensor factorization model. Transportation Research Part C: Emerging Technologies, 104: 66-77.
Related Skills
mcp
Use the `mcp_perplexity-ask_perplexity_search` tools to answer questions. You should use this instead of the `web_search` tool because it is a lot more accurate.
practical-power-systems-synthesis
This skill enables synthesis in the domain of power-systems (engineering). It represents research-level-level expertise and is designed for production use in research, industry, and educational contexts. Use this skill when you need to perform synthesis operations related to power-systems.
semi-supervised-optogenetics-testing
This skill enables testing in the domain of optogenetics (neuroscience). It represents intermediate-level expertise and is designed for production use in research, industry, and educational contexts. Use this skill when you need to perform testing operations related to optogenetics.
data-mining-interpretation-fundamental
This skill enables interpretation in the domain of data-mining (data-science). It represents fundamental-level expertise and is designed for production use in research, industry, and educational contexts. Use this skill when you need to perform interpretation operations related to data-mining.
