Fastest plotting library?

Oh the other reason for fuzzy plots on the website right now is that we changed the default to png, but the default setting is again not supersampled. I wanted to change back to crisp svg for the website but due to a bug that’s reset to png in every example. I’ll follow up with that, it looked much better two weeks ago.

Then the colors like red blue green, I agree these don’t look so nice and I’m all for changing them, sometimes it’s just a lack of inspiration when writing these examples. Just want to show how to change color, so… red? I’m open to improving these, especially if they lower the apparent quality of the library. It’s similar with some example plots, sine waves get old pretty fast but it’s the easiest thing short of random dots :wink:

2 Likes

Ah it’s ok, sometimes such comments just strike a nerve. I did put a lot of effort into the default styles, but with the goal to give a solid base to work from, that works for a lot of people. AlgebraOfGraphics on the other hand is much more opinionated, styled to the taste of Pietro. It’s useful to know for example if almost everybody thinks the ticks are too short, then they can be lengthened. But frame lines can either be shown or not, so some people will always dislike the default choice. So I’ve tried to make every little detail themeable, if the options are unclear docs issues are always appreciated.

18 Likes

Compromise: blinking lines, then you only dislike the default choice half the time!

Fwiw I haven’t given much thought to theme choices so this is a theme-naive perspective (with ggplot2 background) but I’ve been using Makie for a while and I’m generally happy with how its SVGs look by default.

3 Likes

It’s interesting how much importance people place on defaults. I was a GGplot2 guy, before moving to Julia. That package has really ugly defaults. But they are very easy to change with themes/theme elements.

I never liked the default look of Plots.jl, so I was attracted to Makie and especially AoG which are both great! However, I recently had to add some new plots to a manuscript that already contained some nice GGplot2 plots that I’d embedded in LaTeX using TikzDevice. It ended up being really simple to copy the style of those other plots in a few lines of code with plots.jl and save the output as .tex. Anyway I’m just rambling, but the upshot is I pay less attention to defaults now. For my purposes (mainly 2d scatter, lines boxplots, violins) plots.jl is more than up to the task.

2 Likes

Yes it’s important that theming is effortless, and we can improve on that front. It would be best if it’s as easy as saying set_theme!(:minimalistic) or something like that to get a good set of different defaults. And that people can share their themes easily.

4 Likes

Maybe suppressing explicitly the dynamic display accelerates the generation of the plots as well: Deactivate plot display to avoid need for X server

My understanding is that it’s incredibly hard to pick defaults for a wide audience, but I do think that Makie does a good job at providing solid conservative defaults.

Changing to a custom theme is less scary than it sounds. AlgebraOfGraphics (see e.g. the penguin tutorial to get a feeling of the style) has a much more opinionated look, which is achieved via Makie’s theming mechanism. Even though the theme is based on solid design principles, I’m not sure it could be Makie’s default theme.

This is how the theme is defined. It is a fair amount of attributes, but to create your theme you can probably just copy-paste the example and tweak things you don’t like. Note that you can try it out in normal Makie plots just by doing using AlgebraOfGraphics; set_aog_theme!(), and it shouldn’t add too much precompilation overhead.

MakieThemes.jl hasn’t been updated in a while, but I think you could also try copy-pasting, and maybe tweaking, any theme in this folder (it’s a separate project from MakieThemes.jl, but maybe they can be merged in the future).

More than that, my fear is that users (esp. in the beginning) often start by copy-pasting examples, so I’m afraid that we are “giving the bad example” with pure red, blue, green colors. Given that we have a default palette, maybe we could pick from there?

7 Likes

This is exactly what I do. That’s why I really miss the old Makie Gallery. I am not enough of a plotting power user to want to really learn everything about a plotting library, so I usually just find examples that have features and looks I like, copy paste them and then adapt it to my use case.

Especially be side I often don’t even know the name for what I’m looking for, so searching through visual examples is way easier than searching text based docs.

3 Likes

@DNF for some more elaborated GMT plotting examples you may look here. It is definitely very good at mapping but it also seems to shine on some other speciality plots.

3 Likes

@Mason there are some themes here now, I’ll add more in the coming weeks

https://makie.juliaplots.org/stable/predefined_themes.html

14 Likes

Note that Makie is not one of the choices it considers

Yes, it seems Makie can’t be a backend to Plots.jl, may replace it:

It has its own backends: Backends & Output · Makie Plotting Ecosystem

I think this would be a shame, for reasons mentioned here Plots.jl PGFplotsX backend is a massive boon for Julia

I wonder if Plots.jl could be a Makie backend.

I don’t think that making everything a backend of everything else is going to pan out well in the long run.

In the short run it was a perfect stopgap measure: plotting libraries require a lot of investment, because of all the finicky low level details (font/text metrics, various heuristics like axis labeling, etc). But combining wildly different libraries into a single frontend either

  1. gives up on switching backends when you use advanced features, so it is not very useful,
  2. restricts the user to the intersection of features.

IMO Plots.jl is great for exploratory plotting, but becomes really tricky to work with when polishing up plots (eg for a final version of a paper). I think that sticking to a single versatile plotting library from the very beginning may give a better user experience. Which library that will be is a matter of taste and requirements, but now we have multiple great choices.

18 Likes

I am doing something similar here for semiconductor testing. We have test systems which generate large quantities of data in the form of test files, most of which are similar to CSV files.
I am generating the report which includes thousands of plots in the data section of the report.
This accompanies a statistical summary, which is what everyone looks at. But if there is something strange the data report is available and you can usually track down the problem data quickly.

I’m not using Excel. I am generating the plots in PDF and generating a PDF report using LaTeX.
This could include tabular data if required, thus removing the requirement for Excel or other external tool.
But you have to have some detailed knowledge of LaTeX to get it all working.
The result is efficient PDF report files which are easy to examine and digest.

For most plots I am using Gadfly which is quite fast. I need to generate histograms, and I couldn’t get the Gadfly based histograms quite correct. So I switched to PGFPlotsX and got better control of the histograms.
But indeed PGFPlotsX is slow. But there are a couple of things to mitigate this. First, make sure you are using TeX Live! I found it to be about 20 times faster than MiKTeX. You can get a little more speed by parallel processing in the for loops which generate the plots. But you can’t do IO in parallel, so writing the files to disk is done in another loop.
In this use case, speed is not that important and if it takes a while to generate the reports it’s not that big of a deal. Because the entire process of obtaining the data takes a couple of weeks. So an hour or two to generate the reports is a small fraction of that. I run intermediate reports, it’s nice to get that done a little quicker, so that is why I did a little optimization of the histogram generation.

1 Like

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.

2 Likes

@StatisticalMouse, this booklet by Tufte, seems to have made some history.

5 Likes

I have been trying to promote the use of Julia at my workplace.

The very first person that tried it out for actual work came to me with,

I tried to use Plots with the blah-blah-blah backend and it doesn’t work.

I don’t remember what the back-end was. Now i tell everyone up-front, use PyPlot.

They can figure out a better option, if there is one for what they need to do, later.

Thanks, that looks pretty good on this 10.5” ipad pro.

I tried some font identifying with Google and WhatTheFont, which worked reasonably well, or at least better than a couple of other font-identifying services.

Then found this in https://www.edwardtufte.com/bboard/q-and-a-fetch-msg?msg_id=00009r

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.

– Edward Tufte

1 Like

Gil Sans is a system font in MacOS and iOS.

ET Book I found here: ET Book · Edward Tufte on GitHub

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.

1 Like