summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/sparklines
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-12-31 21:26:18 +0000
committerKarl Berry <karl@freefriends.org>2016-12-31 21:26:18 +0000
commit9b491767bcc27a0d41045c2ffad2530455d81763 (patch)
treedf2c26d3f70d6bbf05322d8728ef905a3fa9602a /Master/texmf-dist/doc/latex/sparklines
parentef3722646aa7f034d07d94074504a5c474692d32 (diff)
sparklines (31dec16)
git-svn-id: svn://tug.org/texlive/trunk@42821 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex/sparklines')
-rw-r--r--Master/texmf-dist/doc/latex/sparklines/sparklines.pdfbin35574 -> 136597 bytes
-rw-r--r--Master/texmf-dist/doc/latex/sparklines/sparklines.tex125
2 files changed, 120 insertions, 5 deletions
diff --git a/Master/texmf-dist/doc/latex/sparklines/sparklines.pdf b/Master/texmf-dist/doc/latex/sparklines/sparklines.pdf
index 487d09fdb00..45f9401af48 100644
--- a/Master/texmf-dist/doc/latex/sparklines/sparklines.pdf
+++ b/Master/texmf-dist/doc/latex/sparklines/sparklines.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/sparklines/sparklines.tex b/Master/texmf-dist/doc/latex/sparklines/sparklines.tex
index a489d7d7e22..1e038cbd5f3 100644
--- a/Master/texmf-dist/doc/latex/sparklines/sparklines.tex
+++ b/Master/texmf-dist/doc/latex/sparklines/sparklines.tex
@@ -15,7 +15,7 @@
\title{Sparklines}
\author{Andreas Loeffler \and Dan Luecking}
-\date{updated 19.~October 2014 (version 1.6)}\maketitle
+\date{Updated 27~December 2016 (version 1.7)}\maketitle
\section{What are sparklines?}
@@ -131,7 +131,7 @@ Bar graphs can be drawn easily:
\end{sparkline}.
This was created by the code:
\begin{verbatim}
- \begin{sparkline}{4}
+ \begin{sparkline}{5}
\sparkspike .083 .18
\sparkspike .25 .55
\sparkspike .417 1
@@ -149,6 +149,34 @@ above example was drawn with it changed to \texttt{red}. The width of
each bar is the value of the length \verb$\sparkspikewidth$, which the
user may change (with \verb$\setlength$). The default is \texttt{2pt}.
+You can combine bars and lines:
+\begin{sparkline}{5}
+ \sparkspike .083 .18
+ \sparkspike .25 .55
+ \sparkspike .417 1
+ \sparkspike .583 .62
+ \sparkspike .75 .42
+ \sparkspike .917 .5
+ \spark 0.1 0.95 0.2 0.8 0.3 0.3 0.4 0.52 0.5 0.62
+ 0.6 0.7 0.7 0.5 0.8 0.4 0.9 0.25 1 0.2 /
+ \sparkdot 1 0.2 blue
+\end{sparkline}\space. This was created with
+\begin{verbatim}
+\begin{sparkline}{5}
+ \sparkspike .083 .18
+ \sparkspike .25 .55
+ \sparkspike .417 1
+ \sparkspike .583 .62
+ \sparkspike .75 .42
+ \sparkspike .917 .5
+ \spark 0.1 0.95 0.2 0.8 0.3 0.3 0.4 0.52 0.5 0.62
+ 0.6 0.7 0.7 0.5 0.8 0.4 0.9 0.25 1 0.2 /
+ \sparkdot 1 0.2 blue
+\end{sparkline}\space.
+\end{verbatim}
+
+
+
\paragraph{Colors} In case you want to change colors use
\begin{verbatim}
\definecolor{sparkrectanglecolor}{gray}{0.9}
@@ -165,24 +193,111 @@ before the sparkline environment (see a manual about defining colors in \LaTeX{}
\sparkspike .483 .62
\sparkspike .65 .42
\sparkspike .817 .5
-\sparkbottomline 0.9
+\sparkbottomline[0.9]
\end{sparkline}.
The code used was
\begin{verbatim}
\begin{sparkline}{5}
- \definecolor{sparkbottomlinecolor}{gray}{0.9}
+ \definecolor{sparkbottomlinecolor}{gray}{0.9}
\sparkspike .15 .55
\sparkspike .317 1
\sparkspike .483 .62
\sparkspike .65 .42
\sparkspike .817 .5
- \sparkbottomline 0.9
+ \sparkbottomline[0.9]
\end{sparkline}.
\end{verbatim}
Changing the color of the bottom line is quite easy using the command
+like
+\begin{verbatim}
+\definecolor{sparkbottomlinecolor}{named}{red}
+\end{verbatim}. You can change the thickness of the bottom line using
+command like
+\begin{verbatim}
+\setlength\sparkbottomlinethickness{1pt}
+\end{verbatim}
+
+The optional argument of \verb|\sparkbottomline| is the length of the
+bottom line (by default~1).
+
+If you need to set both start and end of the bottomline, use
+\verb|\sparkbottomlinex| command, which has two obligatory arguments:
+the start and the end, for example,
+\definecolor{sparkbottomlinecolor}{named}{blue}%
+ \begin{sparkline}{5}
+ \sparkspike .15 .55
+ \sparkspike .317 1
+ \sparkspike .483 .62
+ \sparkspike .65 .42
+ \sparkspike .817 .5
+ \sparkbottomlinex 0.3 0.8
+ \end{sparkline}. This was created with the code
+\begin{verbatim}
+ \begin{sparkline}{5}
+ \sparkspike .15 .55
+ \sparkspike .317 1
+ \sparkspike .483 .62
+ \sparkspike .65 .42
+ \sparkspike .817 .5
+ \sparkbottomlinex 0.3 0.8
+ \end{sparkline}
+\end{verbatim}
+
+\paragraph{Clipping}
+
+Sometimes you may have sparklines outside the drawing region, for
+example,
+ \begin{sparkline}{10}
+ \sparkrectangle 0.3 0.8
+ \sparkdot 0.5 0.62 blue
+ \sparkdot 1 0.2 red
+ \spark 0.1 0.95 0.2 0.8 0.3 0.3 0.4 2.52 0.5 0.62
+ 0.6 0.7 0.7 0.5 0.8 0.4 0.9 0.25 1 0.2 /
+ \end{sparkline}. You may want to clip them. The starred version
+ \verb|sparkline*| creates \emph{clipped} sparklines: the graphics
+ outside the rectangle (0,0) -- (1,1) plus a thin border of the width
+ \verb|\sparklineclipsep| is clipped:
+ \begin{sparkline*}{10}
+ \sparkrectangle 0.3 0.8
+ \sparkdot 0.5 0.62 blue
+ \sparkdot 1 0.2 red
+ \spark 0.1 0.95 0.2 0.8 0.3 0.3 0.4 2.52 0.5 0.62
+ 0.6 0.7 0.7 0.5 0.8 0.4 0.9 0.25 1 0.2 /
+ \end{sparkline*}. The first sparkline was created with
+\begin{verbatim}
+ \begin{sparkline}{10}
+ \sparkrectangle 0.3 0.8
+ \sparkdot 0.5 0.62 blue
+ \sparkdot 1 0.2 red
+ \spark 0.1 0.95 0.2 0.8 0.3 0.3 0.4 2.52 0.5 0.62
+ 0.6 0.7 0.7 0.5 0.8 0.4 0.9 0.25 1 0.2 /
+ \end{sparkline}.
+\end{verbatim}
+The second sparkline was created with
+\begin{verbatim}
+ \begin{sparkline*}{10}
+ \sparkrectangle 0.3 0.8
+ \sparkdot 0.5 0.62 blue
+ \sparkdot 1 0.2 red
+ \spark 0.1 0.95 0.2 0.8 0.3 0.3 0.4 2.52 0.5 0.62
+ 0.6 0.7 0.7 0.5 0.8 0.4 0.9 0.25 1 0.2 /
+ \end{sparkline*}.
+\end{verbatim}
+
+The clipping separation is set to 2~pt. You can change it with
+\begin{verbatim}
+\setlength\sparklineclipsep{...}.
+\end{verbatim}
+
\section*{Version history}
\begin{description}
+
+ \item[] Dev 26, 2016
+
+ version 1.7: Boris Veytsman (borisv@lk.net). Added clipping,
+ extensible bottom lines, some bug fixes.
+
\item[] Oct 19, 2014
version 1.6: Emiel van Miltenburg (emiel.van.miltenburg@vu.nl) - Adding a bottom line (the x-axis, this is useful to visually separate different bar charts that are next to each other) and changing the color of the bottom line.