Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add legend in showed window? #910

Open
ghost opened this issue Feb 21, 2024 · 2 comments
Open

How to add legend in showed window? #910

ghost opened this issue Feb 21, 2024 · 2 comments

Comments

@ghost
Copy link

ghost commented Feb 21, 2024

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?

@stevenlovegrove
Copy link
Owner

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.

@ghost
Copy link
Author

ghost commented Mar 7, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant