Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
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

Drawing regression lines

Drawing regression lines is an excellent way to visualize the association between two non-independent variables. Gadfly and AlgebraOfGraphics offer easy ways to create such plots. There are two kinds of regression lines we can make with these packages. The first is a classical linear regression to visualize the linear association between two variables. The second is a local regression, usually using a locally estimated scatterplot smoothing (LOESS) method. The LOESS method performs polynomial regressions on subsets of the data points. Therefore, they have two important parameters: the bandwidth or smoothing parameter and the degree of the polynomials. The bandwidth determines the sizes of the data subsets. Therefore, small bandwidth values create regressions that are sensitive to the local variations.

We can create these plots in Gadfly using Stat.smooth. This function takes a model keyword argument to select between a linear model, passing the :lm symbol...

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 R$50/month. Cancel anytime