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

Add colorbar argument to july.calendar_plot() #22

Open
bkimball98 opened this issue Dec 10, 2021 · 2 comments
Open

Add colorbar argument to july.calendar_plot() #22

bkimball98 opened this issue Dec 10, 2021 · 2 comments

Comments

@bkimball98
Copy link

Hey there,

Just throwing this idea out; I think having a legend next to the individual months [shown below] would be a nice feature to have as an arg to july.calendar_plot(). If I'm blind and it already exists, could you let me know where?

Thanks,
BK
Calendar

@RAraghavarora
Copy link

You can generate a new colorbar, by creating your own mappable:

july.calendar_plot(df2['DATE'], df['MOOD'], cmap=cMap)

# Create Mappable for colorbar
norm = Normalize(vmin=0, vmax=2)
sm = plt.cm.ScalarMappable(cmap=cMap, norm=norm)
sm.set_array([])
N = 3

# Generate colorbar
cbar = plt.colorbar(sm, ticks=np.linspace(0, 2, N), boundaries=np.arange(-0.05, 2.1, .1))

@csteele2
Copy link

Doesn't that previous response generate a colormap that may or may not have the same bounds as the calendar? It seems that this code does not allow the passing of vmin, vmax, or a norm, so how it applies the colormap might not be what is intended.

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

3 participants