Re: Primitive Disk Gradient Fills in Graphics
- To: mathgroup at smc.vnet.net
- Subject: [mg110977] Re: Primitive Disk Gradient Fills in Graphics
- From: Murta <rodrigomurtax at gmail.com>
- Date: Thu, 15 Jul 2010 03:10:37 -0400 (EDT)
- References: <i1k0e6$nin$1@smc.vnet.net>
On 14 jul, 06:36, "David Park" <djmp... at comcast.net> wrote:
> Here is a solution using Presentations. You should also be able to do this
> using RegionPlot, Show and some graphics level jumping.
>
> Needs["Presentations`Master`"]
>
> gradientDisk::usage =
> "gradientDisk[{xcenter, ycenter}, radius, color] will draw an \
> outlined colored disk with the color blended from White to full color \
> across the the horizontal dimension.";
> SyntaxInformation[
> gradientDisk] = {"ArgumentsPattern" -> {{_, _}, _, _}};
> gradientDisk[{xcenter_, ycenter_}, radius_, color_] :=
> {RegionDraw[(x - xcenter)^2 + (y - ycenter)^2 < radius^2, {x,
> xcenter - radius, xcenter + radius}, {y, ycenter - radius,
> ycenter + radius},
> ColorFunctionScaling -> False,
> ColorFunction ->
> Function[{x, y},
> Blend[{White, color},
> Rescale[x, {xcenter - radius, xcenter + radius}]]]],
> AbsoluteThickness[1],
> Circle[{xcenter, ycenter}, radius]}
>
> Draw2D[
> {gradientDisk[{0, 0}, 1, Red],
> gradientDisk[{2, 2}, 1/2, Green],
> gradientDisk[{-2, 1}, .45, Blue]},
> Frame -> True,
> PlotRange -> 4
> ]
>
> David Park
> djmp... at comcast.nethttp://home.comcast.net/~djmpark/
>
> From: Murta [mailto:rodrigomur... at gmail.com]
>
> 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!...
Thanks for All the reply.
I will construct it in the ways suggested. But I hope Mathematica 8
came better in this itens!
tks
Rodrigo Murta