Re: Filled Plot
- To: mathgroup at smc.vnet.net
- Subject: [mg62580] Re: Filled Plot
- From: Peter Pein <petsie at dordos.net>
- Date: Tue, 29 Nov 2005 04:44:11 -0500 (EST)
- References: <dme6o2$i64$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Pratik Desai schrieb: > Hi folks, > > I have been having problems with using Filled Plot. Essentially I am > trying to code up a one dimensional FEM code using linear interpolating > functions, but I would like to fill my plots where each element > interacts and FilledPlot does not seem to do its job. Any help or work > arounds?? > > << Graphics`FilledPlot` > n = 4 > h = N[1/n] > phi1[x_] = Table[Piecewise[{{1/h*(x - (i - 1)*h), h*(i - 1) < x < > h*i}, {-1/h*(x - (i + 1)*h), h* > i < x < h*(i + 1)}, {1, x == i*h}}], {i, 0, 1/ > h, 1}] // PiecewiseExpand // Simplify > Plot[{phi1[x][[1]], phi1[x][[2]], phi1[x][[3]]}, {x, 0, 1}] > FilledPlot[{phi1[x][[1]], phi1[x][[2]], phi1[x][[3]]}, {x, 0, 1}] > > Thanks > > Pratik > Hi Pratik, enter SetAttributes[FilledPlot, HoldAll]; before using FilledPlot. This still throws warnings, but at least it plots. Peter