Replies: 2 comments
-
Hi, import pandas as pd
import os
import lets_plot as lp
df = pd.DataFrame(data=[['Subaru', 'Sold', 4], ['Subaru', 'InStock', 16],
['Nissan', 'Sold', 2], ['Nissan', 'InStock', 8],
['Ford', 'Sold', 3], ['Ford', 'InStock', 10],
['Honda', 'Sold', 6], ['Honda', 'InStock', 2],
], columns=['Brand', 'Status', 'Available'])
lp.LetsPlot.setup_html()
p2 = (lp.ggplot(df, lp.aes(x='Brand', y='Status', weight='Available'))
+ lp.geom_bin2d(alpha=0.7)
# access the values directly from df
+ lp.geom_text(lp.aes(label='Available'), label_format="{d}", size=8)
+ lp.scale_fill_gradient(low='lightgreen', high='darkgreen')
+ lp.theme_bw()
) Thanks. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hi @syd-doyen ! Sorry I wasn't able to look at your case earlier. The problem with your original solution was that in |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I'm drawing a heatmap with geom_bin2d and I would like to annotate each bin with number of counts for that bin.
If I add the following line
I get the following. It almost like geom_text does not know how to convert the position in the discrete axes.
Thanks for any tips.
Beta Was this translation helpful? Give feedback.
All reactions