Custom value range for colormaps #12
Replies: 3 comments
-
Hi @HeresJ0nny! I took the liberty to convert your issue into a discussion to better organize feature requests. This is actually a feature I had planned to implement in the future, so thank you for letting me know it’s something you need! I’ll prioritize it in my roadmap and aim to have it implemented within the next few days. If anyone else is interested in contributing to this feature, please let me know — help is always welcome! :) |
Beta Was this translation helpful? Give feedback.
-
I'm moving this task to high priority since it is getting more up votes. |
Beta Was this translation helpful? Give feedback.
-
@HeresJ0nny now it is possible to set custom value ranges for colormaps! This feature is in Peek.2024-12-25.17-09.mp4The IMPLOT3D_TMP void PlotSurface(const char* label_id, const T* xs, const T* ys, const T* zs, int x_count, int y_count, double scale_min = 0.0, double scale_max = 0.0, ImPlot3DSurfaceFlags flags = 0, int offset = 0, int stride = sizeof(T)); I tried to follow the same API as the IMPLOT_TMP void PlotHeatmap(const char* label_id, const T* values, int rows, int cols, double scale_min=0, double scale_max=0, const char* label_fmt="%.1f", const ImPlotPoint& bounds_min=ImPlotPoint(0,0), const ImPlotPoint& bounds_max=ImPlotPoint(1,1), ImPlotHeatmapFlags flags=0); Let me know if you guys have any problems while testing it! Feel free to share a video of your surface plot in our gallery, I would love to see it :) |
Beta Was this translation helpful? Give feedback.
-
Hello.
I'm currently using PlotSurface with a custom colormap (red, white, green). The range of values for the data I'm plotting is always between -1 and +1 but any given batch of data may not actually contain both extreme values of -1 and +1.
Right now the colormap uses the min and max values of the given data batch to determine its interpolation. This means that if my data in a given batch happens to fall between -1 and +0.5 then the value that gets mapped to white is -0.25 instead of +0.0.
I want the value 0 to always map to white though. So I would like to be able to set a min and max value of -1 and +1.
Kind regards.
Beta Was this translation helpful? Give feedback.
All reactions