JetBrains / lets-plot-kotlin

Grammar of Graphics for Kotlin
https://lets-plot.org/kotlin/
MIT License
435 stars 36 forks source link

Is there a feature for displaying images on every bar from geomBar()? #112

Open robercoding opened 2 years ago

robercoding commented 2 years ago

I'm new to data analysis and I started out with lets-plot for data visualization!

Basically I'm trying to find a way to add images in geomBar(), it could be an image on the bottom bar or even extended through all the bar or something like that. The main purpose is to make it more beautiful and easier to catch the report at first instead of reading a text.

But I can't find that feature available there, I've tried with geomImage() but I'm not sure if that's the feature to use, would appreciate any guidance or know if there are plans in the future for adding it

alshan commented 2 years ago

Currently there is no way to add images to a plot. I'm curious, what precisely chart design do you have in mind? It might be interesting feature.

As for geomImage() a) we've added it for a different use-case: geom_image, Image Matrix

b) In Kotlin it doesn't work (has been exposed in the API accidentally :) )

robercoding commented 2 years ago

Hey sorry for the late reply! So basically I was thinking on just adding a different image per bar

if this requires lot to implement, maybe an MVP version where you're just able to add an image like in the next picture that I've attached (from StackOverflow) could be done image

alshan commented 2 years ago

Could you post a link to the StackOverflow post you mentioned?

robercoding commented 2 years ago

This is the one, they've done it on ggplot library (I couldn't find anyone requesting it in lets-plot): https://stackoverflow.com/questions/58677247/how-to-insert-pictures-into-each-individual-bar-in-a-ggplot-graph

alshan commented 2 years ago

Thanks, this is a nice feature to have. Can't add it right away but will keep in mind.