The Issue blindschemes NewFigureSchemesforStata: plotplain ... · The Issue Solutions blindschemes...

20
The Issue Solutions blindschemes The Schemes Adaptation Conclusion 1/17 New Figure Schemes for Stata: plotplain & plottig Daniel Bischof 1 1 University of Zurich November 17, 2016

Transcript of The Issue blindschemes NewFigureSchemesforStata: plotplain ... · The Issue Solutions blindschemes...

Page 1: The Issue blindschemes NewFigureSchemesforStata: plotplain ... · The Issue Solutions blindschemes The Schemes Adaptation Conclusion 3/17 Limitations colorsaredifficulttodifferentiateforcolorblindpeople

The Issue

Solutions

blindschemes

The Schemes

Adaptation

Conclusion

1/17

New Figure Schemes for Stata:plotplain & plottig

Daniel Bischof1

1University of Zurich

November 17, 2016

Page 2: The Issue blindschemes NewFigureSchemesforStata: plotplain ... · The Issue Solutions blindschemes The Schemes Adaptation Conclusion 3/17 Limitations colorsaredifficulttodifferentiateforcolorblindpeople

The Issue

Solutions

blindschemes

The Schemes

Adaptation

Conclusion

2/17

The Default Stata Figure Schemes

12

34

56

4 5 6 7logged number of terrorist events

95% CI Fitted values

logged number of killed people

Page 3: The Issue blindschemes NewFigureSchemesforStata: plotplain ... · The Issue Solutions blindschemes The Schemes Adaptation Conclusion 3/17 Limitations colorsaredifficulttodifferentiateforcolorblindpeople

The Issue

Solutions

blindschemes

The Schemes

Adaptation

Conclusion

3/17

Limitations

colors are difficult to differentiate for colorblind peoplebackground tintingframessymbols, markers, lines often too thickgridlines only parallel to x-axislegends could be placed closer to content of figure

Page 4: The Issue blindschemes NewFigureSchemesforStata: plotplain ... · The Issue Solutions blindschemes The Schemes Adaptation Conclusion 3/17 Limitations colorsaredifficulttodifferentiateforcolorblindpeople

The Issue

Solutions

blindschemes

The Schemes

Adaptation

Conclusion

4/17

Solutions

1 the obvious solution is to produce code

; lots of code . . .

Page 5: The Issue blindschemes NewFigureSchemesforStata: plotplain ... · The Issue Solutions blindschemes The Schemes Adaptation Conclusion 3/17 Limitations colorsaredifficulttodifferentiateforcolorblindpeople

The Issue

Solutions

blindschemes

The Schemes

Adaptation

Conclusion

4/17

Solutions

1 the obvious solution is to produce code; lots of code . . .

Page 6: The Issue blindschemes NewFigureSchemesforStata: plotplain ... · The Issue Solutions blindschemes The Schemes Adaptation Conclusion 3/17 Limitations colorsaredifficulttodifferentiateforcolorblindpeople

The Issue

Solutions

blindschemes

The Schemes

Adaptation

Conclusion

5/17

Solutions

twoway ///

(line numcountries year, lcolor(gs12)) ///

, ylabel(, angle(horizontal)) xtitle("") ///

graphregion(fcolor(white) lcolor(white)

lwidth(vvvthick) ifcolor(white)

ilcolor(white) ilwidth(vvvthick)) ///

plotregion(lcolor(white) lwidth(vvvthick)

ifcolor(white) ilcolor(white)

ilwidth(vvvthick)) ///

legend(cols(1) region(lcolor(white)))

Page 7: The Issue blindschemes NewFigureSchemesforStata: plotplain ... · The Issue Solutions blindschemes The Schemes Adaptation Conclusion 3/17 Limitations colorsaredifficulttodifferentiateforcolorblindpeople

The Issue

Solutions

blindschemes

The Schemes

Adaptation

Conclusion

6/17

Solutions

1 the obvious solution is to produce code; lot’s of code . . .2 use Billy Buchanan’s brewscheme to define your own

designs

3 write a new package addressing some of the keylimitations

Page 8: The Issue blindschemes NewFigureSchemesforStata: plotplain ... · The Issue Solutions blindschemes The Schemes Adaptation Conclusion 3/17 Limitations colorsaredifficulttodifferentiateforcolorblindpeople

The Issue

Solutions

blindschemes

The Schemes

Adaptation

Conclusion

6/17

Solutions

1 the obvious solution is to produce code; lot’s of code . . .2 use Billy Buchanan’s brewscheme to define your own

designs3 write a new package addressing some of the key

limitations

Page 9: The Issue blindschemes NewFigureSchemesforStata: plotplain ... · The Issue Solutions blindschemes The Schemes Adaptation Conclusion 3/17 Limitations colorsaredifficulttodifferentiateforcolorblindpeople

The Issue

Solutions

blindschemes

The Schemes

Adaptation

Conclusion

7/17

Why write a new figure scheme?

! time! ensure quality (create uniform norm)! simplify the usage of more and new colors! many users lack knowledge how to adapt figures

⇒ there seems to be a high demand for new and alternativefigure schemes

Page 10: The Issue blindschemes NewFigureSchemesforStata: plotplain ... · The Issue Solutions blindschemes The Schemes Adaptation Conclusion 3/17 Limitations colorsaredifficulttodifferentiateforcolorblindpeople

The Issue

Solutions

blindschemes

The Schemes

Adaptation

Conclusion

8/17

Solution 3: Write a new figure scheme

I wrote 2 figure schemes:plotplain: very simple, “clean” figure schemeplottig: replicates ggplot2 (R) by Hadley Wickham in mostregards

→ both available with colors distinguishable for colorblindpeople

Page 11: The Issue blindschemes NewFigureSchemesforStata: plotplain ... · The Issue Solutions blindschemes The Schemes Adaptation Conclusion 3/17 Limitations colorsaredifficulttodifferentiateforcolorblindpeople

The Issue

Solutions

blindschemes

The Schemes

Adaptation

Conclusion

8/17

Solution 3: Write a new figure scheme

I wrote 2 figure schemes:plotplain: very simple, “clean” figure schemeplottig: replicates ggplot2 (R) by Hadley Wickham in mostregards

→ both available with colors distinguishable for colorblindpeople

Page 12: The Issue blindschemes NewFigureSchemesforStata: plotplain ... · The Issue Solutions blindschemes The Schemes Adaptation Conclusion 3/17 Limitations colorsaredifficulttodifferentiateforcolorblindpeople

The Issue

Solutions

blindschemes

The Schemes

Adaptation

Conclusion

9/17

Solution 3: blindschemes in the SSC Archive

Page 13: The Issue blindschemes NewFigureSchemesforStata: plotplain ... · The Issue Solutions blindschemes The Schemes Adaptation Conclusion 3/17 Limitations colorsaredifficulttodifferentiateforcolorblindpeople

The Issue

Solutions

blindschemes

The Schemes

Adaptation

Conclusion

10/17

Plotplain

1

2

3

4

5

6

4 5 6 7

logged number of terrorist events

Western Europe

North America

MENA

Page 14: The Issue blindschemes NewFigureSchemesforStata: plotplain ... · The Issue Solutions blindschemes The Schemes Adaptation Conclusion 3/17 Limitations colorsaredifficulttodifferentiateforcolorblindpeople

The Issue

Solutions

blindschemes

The Schemes

Adaptation

Conclusion

11/17

Plottig

1

2

3

4

5

6

4 5 6 7logged number of terrorist events

Western Europe

North America

MENA

Page 15: The Issue blindschemes NewFigureSchemesforStata: plotplain ... · The Issue Solutions blindschemes The Schemes Adaptation Conclusion 3/17 Limitations colorsaredifficulttodifferentiateforcolorblindpeople

The Issue

Solutions

blindschemes

The Schemes

Adaptation

Conclusion

12/17

The colorblind colors

0

2

4

6

8

10

plotplainblind

black

gs10

sky

turquoise

orangebrown

reddish

vermillion

sea

ananas

0

5

10

15

plottig

blackplr1ply1plg1plb1pll1plr2ply2plg2plb2pll2ply3plg3plb3pll3

Page 16: The Issue blindschemes NewFigureSchemesforStata: plotplain ... · The Issue Solutions blindschemes The Schemes Adaptation Conclusion 3/17 Limitations colorsaredifficulttodifferentiateforcolorblindpeople

The Issue

Solutions

blindschemes

The Schemes

Adaptation

Conclusion

13/17

Adaptation of Code: Gridlines

lpoly nkill iyear if region==12, ///

ci legend(off) title("Polynomial fit of terrorist

casualties in Western Europe") ///

note("")

Page 17: The Issue blindschemes NewFigureSchemesforStata: plotplain ... · The Issue Solutions blindschemes The Schemes Adaptation Conclusion 3/17 Limitations colorsaredifficulttodifferentiateforcolorblindpeople

The Issue

Solutions

blindschemes

The Schemes

Adaptation

Conclusion

14/17

Adaptation of Code: Gridlines

1

2

3

4

5

6

logged n

um

ber

of kill

ed p

eople

1970 1980 1990 2000 2010 2020incident year

Polynomial fit of terrorist casualties in Western Europe

Page 18: The Issue blindschemes NewFigureSchemesforStata: plotplain ... · The Issue Solutions blindschemes The Schemes Adaptation Conclusion 3/17 Limitations colorsaredifficulttodifferentiateforcolorblindpeople

The Issue

Solutions

blindschemes

The Schemes

Adaptation

Conclusion

15/17

Adaptation of Code: Gridlines

lpoly nkill iyear if region==12, ///

ci legend(off) title("Polynomial fit of terrorist

casualties in Western Europe") ///

note("") xlabel(, nogrid)

Page 19: The Issue blindschemes NewFigureSchemesforStata: plotplain ... · The Issue Solutions blindschemes The Schemes Adaptation Conclusion 3/17 Limitations colorsaredifficulttodifferentiateforcolorblindpeople

The Issue

Solutions

blindschemes

The Schemes

Adaptation

Conclusion

16/17

Adaptation of Code: Gridlines

1

2

3

4

5

6

logged n

um

ber

of kill

ed p

eople

1970 1980 1990 2000 2010 2020incident year

Polynomial fit of terrorist casualties in Western Europe

Page 20: The Issue blindschemes NewFigureSchemesforStata: plotplain ... · The Issue Solutions blindschemes The Schemes Adaptation Conclusion 3/17 Limitations colorsaredifficulttodifferentiateforcolorblindpeople

The Issue

Solutions

blindschemes

The Schemes

Adaptation

Conclusion

17/17

Conclusion

+ Improvement: Less code needed, users can focus on othertasks

+ Disagreement: Even if you disagree, less changes areneeded for further adaptation

- Concerns: Still issues remain, e.g. overlapping confidenceintervalsFor further information including the working paper on theschemes:

danbischof.com