Sparklines?

103 views
Skip to first unread message

Jorden Mauro

unread,
Feb 2, 2010, 7:43:39 PM2/2/10
to tufte...@googlegroups.com
Hello,

Do we think that tufte-latex should support Sparklines? I know there
are packages right now, but I don't think either of them are quite
nice enough to use. There is [1], which uses PGF and works with
pdfLaTeX and not dvi, and there is [2] which uses pstricks and only
works with dvi. [1] has nicer results and works with the file format
that most (in my experience) LaTeX users target, PDF. However, [2]
seems to be easier to use, in that it lets the user specify just
y-values that don't need to be converted to an internal coordinate
system (as with [1]). The use of PGF in [1] seems to yield much
simpler code with very nice results. It just needs an upgrade, and
while I'm trying to hack it to be nicer, I just don't have as good
TeX-Fu as I'd like.

Even if tufte-latex doesn't want to absorb Sparklines, should we at
least mention them in the documentation as a recommended companion
package?

Jorden

[1] Sparklines -- http://www.ctan.org/tex-archive/graphics/sparklines/
[2] Spark -- http://jblevins.org/projects/spark/

P.S. The specific enhancements I'd like [1] to have can be expressed
by this sample usage:

\begin[mindot=red,maxdot=blue,startdot=black,enddot=black,range=gray]{sparkline}{10}
\sparkvals 12.4 10.8 11.6 12.1 13 11.5 10.3 9.7
\end{sparkline}

The final result should be able to calculate the max, min, and
standard deviation to make the mindot, maxdot, and the range (that
gray band in the background). [1] almost fits this bill, but falls
short.

Perhaps with a default \sparkline command that can be used instead of
the lengthy environment.

Jorden Mauro

unread,
Feb 3, 2010, 8:44:49 PM2/3/10
to tufte...@googlegroups.com
I became more productive than I thought I would. I've attached my take
on sparklines in LaTeX. The package is called sparkln and already does
80% of what it should, plus I implemented binary sparklines, which the
other packages do not have.

Please let me know what you think.

sparkln.sty
Reply all
Reply to author
Forward
0 new messages