Book Image

Interactive Visualization and Plotting with Julia

By : Diego Javier Zea
Book Image

Interactive Visualization and Plotting with Julia

By: Diego Javier Zea

Overview of this book

The Julia programming language offers a fresh perspective into the data visualization field. Interactive Visualization and Plotting with Julia begins by introducing the Julia language and the Plots package. The book then gives a quick overview of the Julia plotting ecosystem to help you choose the best library for your task. In particular, you will discover the many ways to create interactive visualizations with its packages. You’ll also leverage Pluto notebooks to gain interactivity and use them intensively through this book. You’ll find out how to create animations, a handy skill for communication and teaching. Then, the book shows how to solve data analysis problems using DataFrames and various plotting packages based on the grammar of graphics. Furthermore, you’ll discover how to create the most common statistical plots for data exploration. Also, you’ll learn to visualize geographically distributed data, graphs and networks, and biological data. Lastly, this book will go deeper into plot customizations with Plots, Makie, and Gadfly—focusing on the former—teaching you to create plot themes, arrange multiple plots into a single figure, and build new plot types. By the end of this Julia book, you’ll be able to create interactive and publication-quality static plots for data analysis and exploration tasks using Julia.
Table of Contents (19 chapters)
1
Section 1 – Getting Started
6
Section 2 – Advanced Plot Types
12
Section 3 – Mastering Plot Customization

What this book covers

Chapter 1, An Introduction to Julia for Data Visualization and Analysis, introduces the minimal Julia concepts needed to create basic plots using the Plots package, in particular, heatmaps and scatter and line plots. To that end, it will introduce basic data types that serve as input for plotting functions. This chapter will cover the use of packages and how to work with reproducible project environments. It also presents different Julia developing environments. Among those, we will start working with Pluto notebooks—heavily used through this book. All in all, this chapter offers the essential knowledge needed for the rest of the book.

Chapter 2, The Julia Plotting Ecosystem, presents the Julia plotting ecosystem, showing the different plotting libraries available and their relation. Among those packages, we will focus on Plots and Makie—this chapter introduces the latter—and their backends. After reading this chapter, you should be able to choose the most appropriate plotting library for your data visualization task.

Chapter 3, Getting Interactive Plots with Julia, describes how to get interactive plots using Julia. First, this chapter will go through different kinds of interactivity, highlighting the packages that allow you to access them. Among those packages, it presents the Observables package, an essential package in the Julia ecosystem for developing interactive visualizations. Then, this chapter goes deeper into reaching interactivity with Plots and Makie packages and their backends. After that, it introduces the Interact and PlutoUI packages to create interactive visualizations using Jupyter and Pluto notebooks, respectively. Finally, it presents tools to publish and share interactive visualizations using dashboards, web pages, and simple graphical user interfaces.

Chapter 4, Creating Animations, teaches you how to create animations with Plots and Makie. Also, it will help you determine when it could be helpful to produce animations. Finally, this chapter introduces Javis, a drawing library to generate animations in Julia.

Chapter 5, Introducing the Grammar of Graphics, covers the Julia plotting packages based on or inspired by The Grammar of Graphics, namely, Gadfly, VegaLite, and AlgebraOfGraphics. It will also introduce the DataFrames package, crucial for working with tidy data in Julia. Therefore, this chapter is essential for starting to analyze and visualize data.

Chapter 6, Creating Statistical Plots, shows you how to create the most common statistical plots using the different Julia libraries. In particular, this chapter will focus on Plots, Makie, and Gadfly. This chapter, together with the previous one, gives you an excellent primer to start performing data analysis and data visualization tasks with Julia.

Chapter 7, Visualizing Graphs, introduces the LightGraph and MetaGraphs packages to work with graphs and networks. Then, it shows us how to visualize them using GraphPlot, GraphRecipes, and GraphMakie.

Chapter 8, Visualizing Geographically Distributed Data, showcases how to visualize geographically distributed data with choropleth plots using Plots and GeoMakie. After that, the chapter will examine the creation of street maps using the OpenStreetMapX package.

Chapter 9, Plotting Biological Data, shows different packages that allow the visualization and analysis of biological data. In particular, the chapter focuses on visualizing phylogenetic trees, multiple sequence alignments, and protein structures. Finally, it shows how to create a dashboard using DashBio to develop interactive visualizations for biological data.

Chapter 10, The Anatomy of a Plot, explains a plot’s different components. That knowledge is needed to understand the organization of the attributes for customizing those components. To that end, the chapter introduces the different terminology that Plots, Makie, and Gadfly use for their plot elements.

Chapter 11, Defining Plot Layouts to Create Figure Panels, describes how to compose multiple plots into one. To that end, it will first present the powerful Plots layout system. After that, it will introduce the layout capabilities of Makie and Gadfly.

Chapter 12, Customizing Plot Attributes – Axes, Legends, and Colors, covers some interesting attributes to customize your plots—focusing on the Plots package. The chapter first gives you the tools needed for exploring the Plots and Makie attributes without leaving your Julia session. Then, it shows you how to insert LaTeX equations into your Plots and Makie figures. After that, this chapter will teach us how to customize text elements, axes, legends, and colors.

Chapter 13, Designing Plot Themes, shows how to define plot themes—needed to reuse customizations—or use the predefined ones. In particular, this chapter will discuss theming in Plots, Makie, and Gadfly.

Chapter 14, Designing Your Own Plots – Plot Recipes, introduces the Plots and Makie recipe systems to create custom visualizations or whole new plot types. The chapter also shows how to draw shapes and create custom markers using Plots.