Open
Conversation
updating earthpy
Updating from EarthPy master
Updating from earthpy repo
Updating from master
Updating from master
Fixed the last two vignettes so that their thumbnails work. (earthlab#407)
Updating!
Updating from master
Updating from master
Updating!
updating from master
Modis data clarification and CI fixes (earthlab#497)
Update sphinx_gallery from 0.5.0 to 0.6.2 (earthlab#531)
Contributor
Author
|
@lwasser this pr is failing CI because I'm using |
ravi5175
approved these changes
Jul 23, 2020
|
hey @ravi5175 just checking in. did you review this PR or are you just practicing your skills? generally PRs are reviewed by maintainers on OS projects. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #557
Updated the
ep.colorbarfunction to work with GeoDataFrame plots. This was a bit tricky, and I'm not sure this is the exact way we want to implement this, so feedback would be greatly appreciated @lwasser .There are two ways I've figured out to make this work, but neither of them is ideal, so I thought I'd ask for input. I went with what I thought was the simpler way, but wasn't sure if there was a better way.
The way GeoPandas does colorbars is just by setting
legend=Truein theplot()function. To adjust the colorbar, you can give it acaxargument, which will implement thescaleandpadarguments we have in ourep.colorbar()function.In the
ep.colorbar()function, we create a cax object and assign it to the figure. The problem is, this assumes that the object that was passed into theep.colorbar()is what matplotlib calls aScalarMappable, so like an array or a contour map is aScalarMappable. A GeoDataFrame is not inheritely aScalarMappablelike numpy arrays are, so we can do one of two things. We can either make the function have an argument to return the cax before it's applied to the figure and then that can be used ingpd.plot(), which is what I did.The other way would be to create a
ScalarMappablein the function for the plot. This needs a cmap and a norm object for the map. That seemed like a lot of information to get/create in the function, so I avoided this solution.The return cax option does change how the function is implemented a little. See below for how it changes implementation.