plots icon indicating copy to clipboard operation
plots copied to clipboard

Example: Economist graphic

Open erikryb opened this issue 9 years ago • 4 comments

It would be a nice and fun challenge to try to reproduce this graphic from the Economist:

This tutorial does it with ggplot2.

I will try to do this when I have time. I will update on this issue when I get progress.

erikryb avatar Nov 22 '16 09:11 erikryb

Thanks for the suggestion. Here's my attempt: http://lpaste.net/491253858190753792 . It's highlighted a few shortcoming/bugs. I'll try to at least fix the bugs over the next few days. It's still missing the labels and the trend line, those are a bit more difficult.

economist

cchalmers avatar Nov 23 '16 01:11 cchalmers

Impressive looking first attempt! I did some tweaks to it: http://sprunge.us/SDUb?hs. I tried to use linebreaks in the lables, but it appeared as rectangle symbols. Is this a bug? output

erikryb avatar Nov 23 '16 12:11 erikryb

Added trend line. The line is not exactly identical with the original, but it matches the ggplot2 one.

output Code

erikryb avatar Nov 23 '16 21:11 erikryb

Nice, it's getting there. I've pushed the axis line style bug. I guess Rasterific doesn't support adding newlines in text like that (the text just gets sent directly to the backend). I've come up with something messy in the pgf backend, although the vertical alignment is wrong. http://lpaste.net/2772832299341840384

economist

cchalmers avatar Nov 24 '16 14:11 cchalmers