Pangolin
Pangolin copied to clipboard
How to add legend in showed window?
Lets say i plotted many rectangles in one window with different color. These rectangle represent certain objects that i mapped from picture. The rectangles are just constructed with lines only, means inside is empty. So one color used for each rectangle. How can i add legend for each color of these rectangles in the corner of the window, possibly in the below area of the buttons etc, as it got more free space there?
Pangolin has no built-in support for legends / keys, but based on what you describe, you might be asking - "how do I draw colored text?"
One example can be found here https://stevenlovegrove.github.io/Pangolin/emscripten/examples/SimplePlot/ and the code for that is https://github.com/stevenlovegrove/Pangolin/blob/master/components/pango_plot/src/plotter.cpp#L620. It isn't so simple because it uses a custom shader, but could be useful as a starting point if you are so inclined.
Pangolin has no built-in support for legends / keys, but based on what you describe, you might be asking - "how do I draw colored text?"
One example can be found here https://stevenlovegrove.github.io/Pangolin/emscripten/examples/SimplePlot/ and the code for that is https://github.com/stevenlovegrove/Pangolin/blob/master/components/pango_plot/src/plotter.cpp#L620. It isn't so simple because it uses a custom shader, but could be useful as a starting point if you are so inclined.
Thanks for the replied. This helps a lot.