MathGroup Archive 2008

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

Search the Archive

Re: Gradient fill as Background for Plot

  • To: mathgroup at
  • Subject: [mg89730] Re: Gradient fill as Background for Plot
  • From: lehin.p at
  • Date: Thu, 19 Jun 2008 05:43:01 -0400 (EDT)
  • References: <g3033p$maq$> <g32q8b$c4c$>

On 18 June, 12:24, "David Park" <djmp... at> wrote:
> Thanks for pointing out the use of VertexColors.
> On your last question you could take the First part of DensityPlot to obt=
> the primitives.
> Plot[-1/x, {x, -1, 0},
>  Prolog -> {First@DensityPlot[12 x - y, {x, -1, 0}, {y, 0, 12.2}]},
>  PlotRangeClipping -> False]

Thank you very much! It is simple and straightforward! But there
appears additional question: how to make this DensityPlot-background
to fill all image? The option "PlotRangeClipping -> False" gives only
little help. The axes in the Plot gets out of the DensityPlot-
background. I have tried "ImageSize" option for DensityPlot but it
does nothing in this case.

> The regular Mathematica graphics paradigm presents a barrier to many user=
> because to make custom plots and geometric diagrams it is necessary to ju=
> between graphical levels using various combinations of Show, Graphics,
> Prolog, Epilog and First. It's not that it's terribly difficult to do thi=
> but it's enough to stop many users. The Presentations package converts
> everything to graphical primitives so there is a uniform simple syntax fo=
> doing graphics. You can combine primitives and curves or surfaces togethe=
> in one container. You just draw one thing after another. You don't have t=
> use Show, Graphics, Prolog, Epilog or First. So, for your two plots we co=
> use the following.
> Needs["Presentations`Master`"]
> Combining graphical primitives with a Plot curve:
> Draw2D[
>  {Polygon[{ImageScaled[{0, 0}], ImageScaled[{1, 0}],
>     ImageScaled[{1, 1}], ImageScaled[{0, 1}]},
>    VertexColors -> {LightYellow, Yellow, LightYellow, White}],
>   Draw[-1/x, {x, -1, 0}]},
>  AspectRatio -> .6,
>  Axes -> True]
> Combining a DensityPlot with a Plot curve:
> Draw2D[
>  {DensityDraw[12 x - y, {x, -1, 0}, {y, 0, 12.2}],
>   Draw[-1/x, {x, -1, 0}]},
>  AspectRatio -> .6,
>  Axes -> True]
> --
> David Park
> djmp... at comcast.net

It is interesting but Draw2D also produces graphical primitives? Or it
simply converts any passed Graphics-object to graphical primitives?

  • Prev by Date: Re: Will adding RAM help "No more memory available" error?
  • Next by Date: Re: easy plane normal vector question
  • Previous by thread: Re: Gradient fill as Background for Plot
  • Next by thread: Estimating slope from noisy data