Re: Gradient fill as Background for Plot
- To: mathgroup at smc.vnet.net
- Subject: [mg89730] Re: Gradient fill as Background for Plot
- From: lehin.p at gmail.com
- Date: Thu, 19 Jun 2008 05:43:01 -0400 (EDT)
- References: <g3033p$maq$1@smc.vnet.net> <g32q8b$c4c$1@smc.vnet.net>
On 18 June, 12:24, "David Park" <djmp... at comcast.net> wrote: > Thanks for pointing out the use of VertexColors. > > On your last question you could take the First part of DensityPlot to obt= ain > 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= s > because to make custom plots and geometric diagrams it is necessary to ju= mp > between graphical levels using various combinations of Show, Graphics, > Prolog, Epilog and First. It's not that it's terribly difficult to do thi= s > but it's enough to stop many users. The Presentations package converts > everything to graphical primitives so there is a uniform simple syntax fo= r > doing graphics. You can combine primitives and curves or surfaces togethe= r > in one container. You just draw one thing after another. You don't have t= o > use Show, Graphics, Prolog, Epilog or First. So, for your two plots we co= uld > 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.nethttp://home.comcast.net/~djmpark/ It is interesting but Draw2D also produces graphical primitives? Or it simply converts any passed Graphics-object to graphical primitives?