Skip to content
masterclass Buddy

Plotly · Class

go.Choroplethmapbox

Create a Mapbox choropleth in R by pairing GeoJSON polygons with values. Use locations and featureidkey to match each data row to a polygon, then set the map style and view.

Last updated

Syntax

add_trace(type = "choroplethmapbox", geojson = ..., locations = ..., z = ..., featureidkey = ..., colorscale = ...)

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • plotly
  • add_trace
  • choroplethmapbox
  • mapbox
  • featureidkey
  • geojson
  • locations
  • z

Source: Mapbox choropleth maps in R. Checked 2026-11-03.