Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2010

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

Search the Archive

Re: Primitive Disk Gradient Fills in Graphics

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

On 13 Jul., 11:28, Murta <rodrigomur... at gmail.com> 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!...

Hi,

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[]}]

or

BWGradientDisk[] :=
 Graphics[Table[{GrayLevel[r], Circle[{0, 0}, r]}, {r, 0, 1,
    0.001}]];
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..


Cheers,

Markus


  • 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