This document provides examples of code to generate various types of charts and maps using Plotly Express (px). It includes examples for basic charts, scientific charts, statistical charts, and maps. The code snippets demonstrate how to load data, select variables, and customize properties to produce different visualizations like scatter plots, heatmaps, histograms, choropleth maps, and more.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
107 views1 page
Plotly Club Cheat Sheet
This document provides examples of code to generate various types of charts and maps using Plotly Express (px). It includes examples for basic charts, scientific charts, statistical charts, and maps. The code snippets demonstrate how to load data, select variables, and customize properties to produce different visualizations like scatter plots, heatmaps, histograms, choropleth maps, and more.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1
Community Forum Dash Docs
Basic Charts f g = px.parallel_coordinates(df,
df = px.data.tips() color='species_id') df = px.data.iris() f g=px.parallel_categories(df) f g = px.scatter(df, x='sepal_width', y='sepal_length') df = px.data.tips() f g = px.box(df, x='time', y='total_bill') df = px.data.stocks() Maps f g = px.line(df, x='date', y='GOOG') df = px.data.iris() f g = px.scatter_matrix(df) df = px.data.medals_long() df = px.data.election() f g = px.bar(df, x='nation', y='count', df = px.data.tips() geojson = px.data.election_geojson() color='medal') f g = px.violin(df, y='total_bill', box=True) f g = px.choropleth_mapbox(df, geojson=geojson, color='Bergeron', df = px.data.medals_long() df = px.data.tips() locations='district', f g = px.area(df, x='medal', y='count', f g = px.strip(df, x='total_bill', y='day') featureidkey='properties.district',center={'l color='nation') at': 45.5517, 'lon': -73.7073}, mapbox_style='carto positron', zoom=9) df = px.data.tips() f g = px.pie(df, values='tip', names='day') df = px.data.gapminder().query('year 2007') f g = px.scatter_geo(df, df = px.data.tips() Scientific Charts locations='iso_alpha', color='continent', f g = px.treemap(df, hover_name='country', size='pop', path=[px.Constant("all"), 'sex', 'day', df = px.data.medals_wide(indexed=True) projection='natural earth') 'time'], values='total_bill') f g = px.imshow(df) df = pd.read_csv( df = px.data.tips() from skimage import data 'https: raw.githubusercontent.com/plotly/dat f g = px.sunburst(df, path=['day', 'time', img = data.astronaut() asets/master/us cities top-1k.csv') 'sex'],values='total_bill') f g = px.imshow(img, binary_format='jpeg', f g = px.scatter_mapbox(df, lat='lat', binary_compression_level=0) lon='lon', hover_name='City', df = px.data.tips() hover_data=['State', 'Population'], zoom=3, f g = px.icicle(df, path=[px.Constant("all"), df = px.data.election() height=600) 'day', 'time', 'sex'], values='total_bill') f g = px.scatter_ternary(df, a='Joly', f g.update_layout(mapbox_style='open street m f g.update_traces(root_color='lightgrey') b='Coderre', c='Bergeron') ap')
f g = px.scatter_polar(df, r='frequency', f g = px.line_geo(df, locations='iso_alpha', theta='direction') color='continent', projection='orthographic')