MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Primitive Disk Gradient Fills in Graphics

  • To: mathgroup at
  • Subject: [mg110954] Re: Primitive Disk Gradient Fills in Graphics
  • From: "M.Roellig" <markus.roellig at>
  • Date: Wed, 14 Jul 2010 05:34:50 -0400 (EDT)
  • References: <i1hbjk$691$>

On 13 Jul., 11:28, Murta <rodrigomur... at> wrote:
> Hello All
>    There is really no way to do a simple gradient fill inside a disk
> in Mathematica?
>    I'm working in a BubbleChart, and would like to make a graphics
> disk using ChartElements, going to color x to transparent using
> opacity.
>    I get surprised to see that there is no way to work with gradient
> fill inside primitives like Disk.. there is really this?
>    If it's true, please, correct it in Mathematica 8!...


I agree, GradientFill would be nice, as well as TextureFill or any filling
with arbitrary patterns. Until then you can try to construct it by yourself:

GradientDisk[] :=
 Graphics[Table[{Hue[r], Circle[{0, 0}, r]}, {r, 0, 1, 0.001}]] ;
BubbleChart[RandomReal[1, {10, 3}], ChartElements -> {GradientDisk[]}]


BWGradientDisk[] :=
 Graphics[Table[{GrayLevel[r], Circle[{0, 0}, r]}, {r, 0, 1,
BubbleChart[RandomReal[1, {10, 3}],
 ChartElements -> {BWGradientDisk[]}]

This takes quite some time, since many Circles are drawn. If somebody knows
how to rasterize a circly without getting square image borders, one
could use the rasterized image as Element. Maybe exporting to gif
with transparent white background works.

Of course, the same excercise also works with Rectangles etc..



  • Prev by Date: Re: Chi Square Areas
  • Next by Date: Re: Simplest way to get 2 digits from an integer...
  • Previous by thread: Re: Printing part of table
  • Next by thread: Re: Primitive Disk Gradient Fills in Graphics