Join Martin John Hadley for an in-depth discussion in this video Specify custom colors, part of R: Interactive Visualizations with htmlwidgets.
- [Instructor] Specifying your own custom colors…in Plotly charts doesn't work how you might expect it…to work based on the way the rest…of the Plotly library works.…Let's demonstrate that with some examples.…I'm going to open up scatter-and-linechart.R…from our exercise files.…I'm going to decrease the size of my environment…because I don't need to see it for now.…At the top of our script file,…we load the tidyverse library,…which I'll do with Command + Enter.…We'll also load the Plotly library,…as we're going to be creating…interactive charts with Plotly.…
So other than that, we Command + Enter,…then we can see on like six through 11,…we first use the read_csv function to import data…from the scatter_data.csv file.…We then use the mutate verb to add a new color column,…and what this does is it maps concordant…to this hexadecimal color,…and discordant to this hexadecimal color.…So let's run that code with Command + Enter,…and let's just have a look at what our data looks like.…
So I'll pipe scatter_data into View.…
AuthorMartin John Hadley
Start by learning to manage packages and structure data for visualizations with the tidyverse and the pipe operator. Then there is an important question: Which library should you choose? The course introduces five popular options: Leaflet, Plotly, Highcharter, visNetwork, and DataTables (DT). Instructor Martin Hadley shows how to use these libraries to create scattergeo, choropleth, and geolines maps; stacked bar charts, scatter charts, bubble charts, and heat maps; treemaps and time series charts; interactive networks and graphs; and responsive, interactive data tables. Plus, learn how to customize your visualizations with legends and tooltips, and extract click information for Shiny apps.
- Installing htmlwidgets
- Selecting the best htmlwidget
- Creating interactive maps with Leaflet
- Creating interactive charts with Plotly and Highcharter
- Creating interactive networks with visNetwork
- Creating interactive tables with DT
Skill Level Intermediate
Data Visualization Tips and Trickswith Matt Francis2h 14m Intermediate
DC.js for Data Science Essential Trainingwith Emma Saunders5h 3m Intermediate
1. Getting Started with htmlwidgets
2. Creating Interactive Maps with Leaflet
3. Creating Interactive Charts with Plotly
4. Creating Interactive Charts with Highcharter
5. Creating Interactive Networks with visNetwork
6. Creating Interactive Tables
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.