Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

norm the histogram #2

Open
ljwolf opened this issue Nov 9, 2017 · 0 comments
Open

norm the histogram #2

ljwolf opened this issue Nov 9, 2017 · 0 comments

Comments

@ljwolf
Copy link
Member

ljwolf commented Nov 9, 2017

the histogram should be normalized to 0,1 rather letting it take the default values in frequency-space.

this keeps the interaction style the same between stating how big the legendgram is and then working with it later, like if someone wants to, like, add an analytical element to the legend, it'd be easier to work with if we just made the y-axis forced to be 0,1 rather than unknown since it's not displayed. Right now, you can use the legendgram's transAxes to work with it like its y-axis is 0,1, though.

ax = gdf.plot("GI89")
gpd.GeoDataFrame(gdf.iloc[2255].to_frame().T).plot('GI89', linewidth=2, edgecolor='r', ax=ax)
ax.axis('off')
hax = legendgram(plt.gcf(), # grab the figure, we need it
           ax, # the axis to add the legend
           gdf.GI89, # the attribute to map
           np.percentile(gdf.GI89, np.arange(10,110,10)), # the breaks to induce color differences on
           mplpal.Viridis_10, # the palette to use,
           legend_size=(.5,.16), # the size of the subplot, in fractions of the original axis
           loc= 'lower left', # the location on the axis
           clip=(.3,.5) # bounds to clip the view of the histogram
          )
hax.vlines(gdf.iloc[2255].GI89,0,1,color='r', transform=hax.transAxes)

download

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant