A small PGFPlots library to draw horizontal and vertical lines.
Place tikzlibrarypgfplots.hvlines.code.tex in a directory read by your TeX compiler. Load it through
\usetikzlibrary{calc} % required
\usepgfplotslibrary{hvlines}
Gnu General Public version, 3, as for PGFPlots.
Two keys, vertical line
and horizontal line
are defined that could be called
in the options of axis. They took key-values with key at
for the position and
style
for the style of the line.
The lines are plotted before the addplot
through the execute at begin axis
.
Example
\begin{axis}[vertical line={at=2.5,style={blue}},horizontal line={at=1.5,style={dashed,->}}]
\addplot table {
1 1
2 2
3 3.5};
\end{axis}
For an alternative possibility, see this Stack Exchange question
This is an experimental, alpha release, designed first for personnal use.
- Add commands for defining nodes.
- Dealing with missing value
at
.