epezent / implot

Immediate Mode Plotting
MIT License
4.65k stars 517 forks source link

Circle Looks more like Hexagon when s ized #366

Open aDioS786 opened 2 years ago

aDioS786 commented 2 years ago

Hi Not sure why circle looks more like hexagon, and also if the weight is increased it the boundaries looks like flower.

Circle Code: ImPlot::SetNextMarkerStyle(ImPlotMarker_Circle, radiusSize, FillColor, thickness, OutFillColor); ImPlot::PlotScatter(name, &xyCoordinate[0], &xyCoordinate[1], 1);

image

And this is how it looks like if thickness is increased:

image

lesauxvi commented 2 years ago

Because the circle is rasterized with 10 points. You can have a look at the method called RenderMarkerCircle in the file implot_items.cpp.

epezent commented 2 years ago

Correct. It's not expected for anyone to render markers this large, so circles only use 10 points to keep their cost low. If you need large circles I suggest custom rendering.

aDioS786 commented 2 years ago

Correct. It's not expected for anyone to render markers this large, so circles only use 10 points to keep their cost low. If you need large circles I suggest custom rendering.

Because the circle is rasterized with 10 points. You can have a look at the method called RenderMarkerCircle in the file implot_items.cpp.

Many Thanks, I'll try find where it's setting/using 10 points and maybe increase them a bit. Any plan on adding points as an additional parameter in future so we can use increased params if needed?

epezent commented 2 years ago

Many Thanks, I'll try find where it's setting/using 10 points and maybe increase them a bit. Any plan on adding points as an additional parameter in future so we can use increased params if needed?

No, I don't plan on making points an argument to PlotScatter etc. since it does not apply to any other marker types. But, I do have plans to add a PlotBubbles (see #298). That plotter will probably need a smart way of determining the number of req'd points so that the bubbles are smooth at all sizes. Stay tuned.

aDioS786 commented 2 years ago

That be a nice features looks great. Huge thanks to you for ur hard effort doing this project.

One more questions we have a legend on left, is there a way or any built in function we got, say I want to click on first item in legend, when clicked i want the graph or canvas area to focus on that legend/plotted item. Is that possible to pick coordinates and fo cus on that area on click? Thanks