From the course: Data Visualizations with Plotly
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Introduction to the figure in Plotly - Plotly Tutorial
From the course: Data Visualizations with Plotly
Introduction to the figure in Plotly
- [Instructor] All the customizations and power of Plotly come through the figure object. The figure stores all the parameters that dictate how our visual will come together. It's then rendered by the Plotly.js for JavaScript backend. To really understand how Plotly works and put it to use for your work, you'll want to be very comfortable with the figure. So let's dive in. First, we'll import plotly.express as px. Then, we'll import the gapminder dataset for New Zealand and create a bar plot with year on the x-axis and population on the y. Now to see our visual, we call fig.show. This time, we'll also print our figure to see what's going on under the hood. Up top, we see our visual, and down below, we see the fig, or figure. This JSON-like object is generated by Plotly Express and it contains all the information Plotly needs to create our visual. The first attribute of figure, called data, consists of what are called…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.