Part 8 of our PyCon.DE 2018 series introduces the concepts behind the grammar of graphics and how to use them in Python by means of the Altair library and the Vega specification.
PyCon.DE is where Pythonistas in Germany can meet to learn about new and upcoming Python libraries, tools, software, and data science. In 2018 we had more than 500 participants in Karlsruhe, a city where approximately 3600 IT companies with more than 36000 jobs exist.
According to Wikipedia, a set of structural rules governing the composition of clauses, phrases and words in any given natural language is a grammar, so a grammar of graphics is the set of structural rules governing the composition of visual elements. Using composition to transform data into visual representation is quite powerful and allows to create complex visualisations with simple building blocks.
One of the few plotting libraries in Python that provide such a declarative and compositional API is Altair, backed by the Vega specification, which is relatively new, considering the ideas behind the grammar of graphics date back to the 80s.
In the talk, we introduce the core concepts behind the grammar of graphics and show practical examples of the Altair API in Python to create Vega plots. Malte Harder is a Data Scientist at Blue Yonder doing data engineering with a passion for visualisations.