epezent / implot

Immediate Mode Plotting
MIT License
4.82k stars 531 forks source link

accompanying RemoveColormap() function to AddColormap() #476

Open unix-based-system opened 1 year ago

unix-based-system commented 1 year ago

Dear ImPlot Developers,

I wanted to reach out and express my appreciation for the excellent features and functionality provided by the dear ImPlot library. It has greatly facilitated my work in creating interactive and visually appealing plots for my projects.

Currently, I am facing a situation where I need to dynamically create datasets during runtime. The challenge I'm encountering is that the accompanying colormap for these datasets is not known upfront. Each dataset might require a different colormap to effectively represent its characteristics.

While ImPlot already provides a variety of built-in colormaps, it would be immensely useful to have a corresponding RemoveColormap() to the AddColormap() function that allows me to remove a colormap when it is no longer needed. This would help manage resources efficiently and prevent any potential memory leaks when switching between different datasets.

Alternatively, another approach that would greatly assist me is the ability to create/add a temporary colormap for the current widget only. This temporary colormap would be created and associated with the plot widget dynamically during each loop iteration and automatically removed after the plot is rendered. This way, I could create a new colormap for each dataset and ensure that the colors are appropriately matched to the data without cluttering the internal state or causing conflicts with other plots or widgets.

Having the ability to remove colormaps or create temporary colormaps for individual widgets would enhance the flexibility and adaptability of ImPlot, allowing for more seamless integration with dynamic data generation and visualization scenarios.

Thank you for considering my suggestions, and once again, thank you for developing such a powerful and user-friendly plotting library.

Best regards, Pim

NogginBops commented 6 months ago

Pinging this issue as I also tried to dynamically generate colormaps during runtime and this is complicated by the fact that it's not possible to remove colormaps nor edit their contents. Enabling either two of these features would be great!