Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Interactive Visualization and Plotting with Julia

You're reading from   Interactive Visualization and Plotting with Julia Create impressive data visualizations through Julia packages such as Plots, Makie, Gadfly, and more

Arrow left icon
Product type Paperback
Published in Aug 2022
Publisher Packt
ISBN-13 9781801810517
Length 392 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Diego Javier Zea Diego Javier Zea
Author Profile Icon Diego Javier Zea
Diego Javier Zea
Arrow right icon
View More author details
Toc

Table of Contents (19) Chapters Close

Preface 1. Section 1 – Getting Started
2. Chapter 1: An Introduction to Julia for Data Visualization and Analysis FREE CHAPTER 3. Chapter 2: The Julia Plotting Ecosystem 4. Chapter 3: Getting Interactive Plots with Julia 5. Chapter 4: Creating Animations 6. Section 2 – Advanced Plot Types
7. Chapter 5: Introducing the Grammar of Graphics 8. Chapter 6: Creating Statistical Plots 9. Chapter 7: Visualizing Graphs 10. Chapter 8: Visualizing Geographically Distributed Data 11. Chapter 9: Plotting Biological Data 12. Section 3 – Mastering Plot Customization
13. Chapter 10: The Anatomy of a Plot 14. Chapter 11: Defining Plot Layouts to Create Figure Panels 15. Chapter 12: Customizing Plot Attributes – Axes, Legends, and Colors 16. Chapter 13: Designing Plot Themes 17. Chapter 14: Designing Your Own Plots – Plot Recipes 18. Other Books You May Enjoy

Creating plotting recipes

The Plots ecosystem offers the RecipesBase package so that you can add plotting recipes. It is handy as a package developer since it offers minimum loading overhead for your package. It has no dependencies and enables access to Plots’ plotting capabilities. To that end, the package exports the @recipe macro, which takes a function definition that describes our recipe. We have different recipe types, depending on the type signature of the defined method, as the system uses Julia’s multiple dispatch.

The @recipe macro has a special syntax for setting attribute values. We can use the --> operator to select a different default value for the attribute. This states that the attribute should take the given value if the user has not set it. We can use the := operator instead to force a given value for an attribute. Both operators take the attribute on the left-hand side and the desired value on the right-hand side. For example, the following code...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime