Skip to content

Commit

Permalink
Reverse the colormap.
Browse files Browse the repository at this point in the history
  • Loading branch information
ResidentMario committed Feb 4, 2018
1 parent a894084 commit 3ea54ea
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ have them you can run:

![alt-text][large-geoplot]

[large-geoplot]: https://i.imgur.com/glZonpD.png
[large-geoplot]: https://i.imgur.com/BJROapk.png

If no geographical context can be provided, `geoplot` will compute a
[quadtree](https://en.wikipedia.org/wiki/Quadtree) nullity distribution, as above, which splits the dataset into
Expand All @@ -177,15 +177,15 @@ If you can specify a geographic grouping within the dataset, you can plot your d

![alt-text][hull-geoplot]

[hull-geoplot]: https://i.imgur.com/RALL9d9.png
[hull-geoplot]: https://i.imgur.com/osnPwEE.png

Convex hulls are usually more interpretable than the quadtree, especially when the underlying dataset is relatively
small (as this one is). We again see a data nullity distribution that's seemingly at random, giving us confidence
that the nullity of collision records is not geographically variable.

The `msno.geoplot` chart type extends the `aggplot` function in the `geoplot` package, and accepts keyword arguments
to the latter as parameters. [The `geoplot` documentation provides further details](https://residentmario.github.io/geoplot/index.html)
(including how to pick [a better map projection](https://i.imgur.com/KSryo6o.png)). For more advanced configuration
(including how to pick [a better map projection](https://i.imgur.com/0aaNa9Q.png)). For more advanced configuration
details for the rest of the plot types, refer to the `CONFIGURATION.md` file in this repository.

That concludes our tour of `missingno`!
Expand Down
6 changes: 3 additions & 3 deletions missingno/missingno.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ def dendrogram(df, method='average',
def geoplot(df,
filter=None, n=0, p=0, sort=None,
x=None, y=None, figsize=(25, 10), inline=False,
by=None, cmap='YlGn_r', **kwargs):
by=None, cmap='YlGn', **kwargs):
"""
Generates a geographical data nullity heatmap, which shows the distribution of missing data across geographic
regions. The precise output depends on the inputs provided. If no geographical context is provided, a quadtree
Expand All @@ -445,7 +445,7 @@ def geoplot(df,
:param y: The variable in the dataset containing the y-coordinates of the dataset.
:param by: If specified, plot in convex hull mode, using the given column to cluster points in the same area. If
not specified, plot in quadtree mode.
:param cmap: The colormap to display the data with. Defaults to `YlGn_r`.
:param cmap: The colormap to display the data with. Defaults to `YlGn`.
:param inline: Whether or not the figure is inline. If it's not then instead of getting plotted, this method will
return its figure.
:param kwargs: Additional keyword arguments are passed to the underlying `geoplot` function.
Expand All @@ -458,7 +458,7 @@ def geoplot(df,
df = nullity_filter(df, filter=filter, n=n, p=p)
df = nullity_sort(df, sort=sort)

nullity = df.isnull().sum(axis='columns') / df.shape[1]
nullity = df.notnull().sum(axis='columns') / df.shape[1]
if x and y:
gdf = gpd.GeoDataFrame(nullity, columns=['nullity'],
geometry=df.apply(lambda srs: Point(srs[x], srs[y]), axis='columns'))
Expand Down

0 comments on commit 3ea54ea

Please sign in to comment.