Skip to content

Instantly share code, notes, and snippets.

@vicapow
Last active June 25, 2025 22:40
Show Gist options
  • Save vicapow/b89b7ab8c90da3031b852d3e8c3d50b7 to your computer and use it in GitHub Desktop.
Save vicapow/b89b7ab8c90da3031b852d3e8c3d50b7 to your computer and use it in GitHub Desktop.
Crixet Gist
% Required package: add \usepackage{pgfplots} in the preamble for this to work.
\documentclass{article}
\usepackage{pgfplots} % Add this line to your preamble if not already present.
\begin{document}
Hello, Crixet!
% Example scatterplot using pgfplots
\begin{figure}[h!]
\centering
\begin{tikzpicture}
\begin{axis}[
title={Example Scatterplot},
xlabel={X Axis},
ylabel={Y Axis},
grid=both,
width=0.7\linewidth,
height=0.4\linewidth,
only marks,
scatter/classes={
a={mark=*,blue},
b={mark=triangle*,red}
}
]
\addplot[
scatter,
only marks,
scatter src=explicit symbolic
]
table[meta=label] {
x y label
1 2 a
2 3 a
3 2.5 b
4 4 a
5 3.5 b
6 5 a
};
\end{axis}
\end{tikzpicture}
\caption{A simple scatterplot with example data.}
\end{figure}
\end{document}
% This example uses pgfplots to create a scatterplot. Add \usepackage{pgfplots} to your preamble if not already present.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment