Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Added PlotBubbles #611

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

Open
Luc16 wants to merge 5 commits into epezent:master
base: master
Choose a base branch
Loading
from Luc16:plotbubbles
Open

Added PlotBubbles #611

Luc16 wants to merge 5 commits into epezent:master from Luc16:plotbubbles

Conversation

@Luc16
Copy link

@Luc16 Luc16 commented Feb 19, 2025

Summary
This PR adds support for bubble plots to ImPlot, inspired by MATLAB’s bubblechart. Existing plot functionality is unaffected.


Function signatures

IMPLOT_TMP void PlotBubbles(const char* label_id, const T* values, const T* szs, int count, double xscale=1, double xstart=0, ImPlotBubblesFlags flags=0, float min_pxsize=3, float max_pxsize=50, int offset=0, int stride=sizeof(T));
IMPLOT_TMP void PlotBubbles(const char* label_id, const T* xs, const T* ys, const T* szs, int count, ImPlotBubblesFlags flags=0, float min_pxsize=3, float max_pxsize=50, int offset=0, int stride=sizeof(T));
IMPLOT_API void PlotBubblesG(const char* label_id, ImPlotGetter3D getter, void* data, int count, ImPlotBubblesFlags flags=0, float min_pxsize=3, float max_pxsize=50);
  • min_pxsize and max_pxsize set the minimum and maximum bubble diameters (in pixels).
  • By default, marker outlines are not rendered and the fill color alpha is set to 0.5.

Example
Below is an example bubble plot (two different datasets). The bubble sizes are scaled between the specified min_pxsize and max_pxsize ([3, 50] for blue and [5, 20] for orange):

image


Feedback
Please let me know if there are any suggestions or improvements regarding:

  • The API signature or naming.
  • Default styling choices (e.g., alpha, line rendering).
  • Performance or edge-case handling.

I appreciate any comments or reviews on how to refine this feature!

brenocq and vtx22 reacted with heart emoji
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /