Plot Feature Concerning Number of Points Generated With Zero Function
- To: mathgroup at smc.vnet.net
- Subject: [mg48450] Plot Feature Concerning Number of Points Generated With Zero Function
- From: "David Park" <djmp at earthlink.net>
- Date: Sun, 30 May 2004 06:12:11 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
Dear MathGroup, Consider plotting a constant... Plot[1, {x, 0, 5}] // First; % /. Line[pts_] :> Length[pts] {{25}} We obtain 25 points for almost any value of the constant. Except if we use zero for the constant. plotzero = Plot[0, {x, 0, 5}] // First; % /. Line[pts_] :> Length[pts] {{901}} 901 points certainly seems excessive. Furthermore it can be a problem if transformations are done on the points. For example, Show[Graphics[plotzero /. {x_?NumberQ, y_?NumberQ} -> {x, y - x}]]; produces a thick somewhat jagged line (depending on the AspectRatio) because of the excessive number of points. This can be overcome by using the PlotPoints option, but it still singles out the zero function as a special case. David Park djmp at earthlink.net http://home.earthlink.net/~djmp/