# Jagged Edges in Scatter Charts Circles

Hi folks,

I'm currently trying to plot some Bubble Charts using the scatter plot
function.

It works beautifully, but the circles drawn are a little too jagged for
my liking.

I'm following the example shown here -

http://matplotlib.sourceforge.net/screenshots.html
(look for scatter plot)

Even in the example picture, you can see slight jagged edges in bigger
circles.

http://matplotlib.sourceforge.net/screenshots/scatter_demo2_large.png

Does anyone have a clue on how I can improve the way the bubbles are
rendered?

···

--
Kelvin Quee
+65 9177 3635
kq@...2058...

Bridging People with Ideas
http://InteresThink.com

You can pass in a "marker" argument with a tuple of the form (numsides, style, angle) to scatter.

*numsides*:
the number of sides

*style*:
the style of the regular symbol:

===== ==================
Value Description
===== ==================
0 a regular polygon
1 a star-like symbol
2 an asterisk
===== ==================

*angle*:
the angle of rotation of the symbol

For example:

scatter(marker=(100, 0, 0))

You can make "numsides" as high as you need until it's smooth enough at the sizes you need.

On a related note, now that matplotlib can use splines to draw circles (in the 0.98.x series), matplotlib should probably do that for scatter circles. This will require changing some code on our end. This will avoid requiring the kind of workaround I suggest above.

Cheers,
Mike

Kelvin Quee wrote:

···

Hi folks,

I'm currently trying to plot some Bubble Charts using the scatter plot
function.

It works beautifully, but the circles drawn are a little too jagged for
my liking.

I'm following the example shown here -

http://matplotlib.sourceforge.net/screenshots.html
(look for scatter plot)

Even in the example picture, you can see slight jagged edges in bigger
circles.

http://matplotlib.sourceforge.net/screenshots/scatter_demo2_large.png

Does anyone have a clue on how I can improve the way the bubbles are
rendered?

--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA

Hi Michael,

Thanks!

This really does the trick. The circles look beautiful and smooth now.

You rock!

Kelvin Quee

Michael Droettboom wrote:

···