plotly / plotly/plotly.py

[BUG]: Odd polygon in land layer, extending into Canada on US choropleth

Aperta
#5,685 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

bug P3 size: 3
Lingua principale
Python
Stelle
18.8k
Fork
2.8k
Merge medio
16h 26m
PR unite (30g)
21

Descrizione

Description

There is an odd band extending from the northwest US into Canada when making a US choropleth. You can see this in the official documentation. I think this stems from the GeoJSON file included in Plotly. The file is very out of date, by the way, with changes to Oglala Lakota County in South Dakota and the Kusilvak Census Area in Alaska not being represented.

I can hide this band in the Python version using visible=False when calling update_geos().

Screenshots/Video
Image
Steps to reproduce
Notes

The unemployment example is here for completeness' sake:

from urllib.request import urlopen
import json
with urlopen('https://raw.githubusercontent.com/plotly/datasets/master/geojson-counties-fips.json') as response:
    counties = json.load(response)

import pandas as pd
df = pd.read_csv("https://raw.githubusercontent.com/plotly/datasets/master/fips-unemp-16.csv",
                   dtype={"fips": str})

import plotly.express as px

fig = px.choropleth(df, geojson=counties, locations='fips', color='unemp',
                           color_continuous_scale="Viridis",
                           range_color=(0, 12),
                           scope="usa",
                           labels={'unemp':'unemployment rate'}
                          )
fig.update_layout(margin={"r":0,"t":0,"l":0,"b":0})
fig.show()

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia con l'esempio della coropletica della disoccupazione ed esamina il file geojson-counties-fips.json referenziato dal repository plotly/datasets. Confronta la geometria del nord-ovest e le voci per Oglala Lakota County e Kusilvak Census Area; il lavoro è terminato quando l'esempio non mostra più la banda e queste modifiche alle contee sono rappresentate.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
python
Ambito
data-visualization
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Tranquilla
Chiarezza
Abbastanza chiara
Idoneità per principianti
55/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.