There was some discussion above about what plots look good, and what don’t… Personally, the best plots I’ve seen have been in Edward Tufte’s books, physical books. I’ve been considering if I should just order the whole set of them. My former employer had a couple.
No, the Tufte-like computer plots are nowhere near as good looking as those that have probably been drawn by hand. There also aren’t many pictures online.
In general, I use Gill Sans and ETBembo for everything in print; those typefaces are beautiful and work for my purposes. There is no content-need to develop new typographic styles for my work. There are too many substantive matters to think about and thus I want to limit the number of design decisions. Thus I try not to re-open solved typographic designs.
ET Book is a Bembo-like font for the computer designed by Dmitry Krasny, Bonnie Scranton, and Edward Tufte. It is free and open-source.
It was used in Beautiful Evidence, and some of his other digitally released books. Tufte’s earlier books on analytical design were set in real lead in Monotype Bembo. While Monotype Bembo was an excellent book font, when converted to an electronic font, it became thin and spindly (the computer people ignored “squeeze”, the slight spreading of ink when the lead type hits the paper). So he, Krasny, and Scranton made their own computer version and also made some design changes (ligatures, several problems with the pi font, some letterforms, creation of a semibold). Adam Schwartz converted the digital font into a webfont and created this project, which exists on GitHub.
Speaking of Tufte… and showcasing Julia… and choice if plotting library.
I’m putting my notes/problem solutions from a mathematical biology book into a nice pdf that I hope to share with students from my university, once it’s finished. I’m using Weave.jl with a custom template that uses the Tufte-handout class. Plotting a symbolic equation is straight forward using Plots.jl recipes defined by Symbolics.jl and thus shows the elegance of Julia. Setting chunck options
fig_env = "marginfigure", fig_pos = "-2cm"
(You have to put something in fig_pos )
Will put your plot in the margin if you so desire.
Took me a bit to figure out I could use tufte styles and marginfigures directly in weave.jl. so I thought I’d share.
I find that using the lualatex engine (which PGFPlotsX should use automatically when available), speeds are reasonable. TeX, as originally designed, is not really suitable for the kind of computation that pgfplots (the LaTeX package) does.
That said, these days I try to keep my plots simple and clean (contours instead of overplotted scatter, etc) which results in graphics with a few primitives, so I get <2s compilation times on most of my plots. Not great, not terrible.
Coming back to performance comparisons, I found Plots(Gr) and Gaston to be similar in terms of plotting and saving speed.
However, I observed that the savefig time scales with the number of points. Although convenient for small number of points(beating Matlab), it gets slow for plots with tens of thousands of points. Matlab has constant saving time (1-2s).
Any suggestion on how to improve this?
function test_Plots(npts, nlines)
t = LinRange(0,1,npts)
y = randn(length(t))
h=Plots.plot(t, y, title = "Lines", label = "Line 0")
Plots.plot!(t, i .* y, label = "Line $i")
test_Plots(100, 10) # 0.121…
test_Plots(1000, 10) # 0.330...
test_Plots(10000, 10) # 2.32…
And there is the underrated UnicodePlots, which is what I use for personal consumption and should be pretty fast.
I confess: I still haven’t migrated to Julia for publication plots: I use either TikZ+PGFPlots (for diagrams, timelines, and such) or R’s ggplot2 (for data, exporting and importing data between Julia and R). The main reason is that when I started using Julia, plotting packages weren’t as mature as they are now. I often found that I needed one package for one type of plot (say a stem-and-leaf plot), and another package for another type (say a 3d phase diagram). And they wouldn’t look great side by side because of different fonts and styles. If I learned how to control tick lengths with one package, I’d have it all to learn again for another package. I didn’t fight it very long and retreated to what I already knew. However, the problem these days is quite different: too many choices!
If the OP wants to save output as PNGs to disk, ImPlot.jl is a poor choice–there’s no backend for producing figures/saving visualizations. It’s strictly for looking at your data interactively, monitoring streaming data, etc and embedding those visualization into GUIs built with CImGui.jl
From the implot FAQ:
Q: Is ImPlot the right plotting library for me?
A: If you’re looking to generate publication quality plots and/or export plots to a file, ImPlot is NOT the library for you. ImPlot is geared toward plotting application data at realtime speeds. ImPlot does its best to create pretty plots (indeed, there are quite a few styling options available), but it will always favor function over form.