Re: How to remove an artifact from a plot
- To: mathgroup at smc.vnet.net
- Subject: [mg81927] Re: How to remove an artifact from a plot
- From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
- Date: Sun, 7 Oct 2007 05:25:05 -0400 (EDT)
- Organization: The Open University, Milton Keynes, UK
- References: <fe7hru$oq7$1@smc.vnet.net>
john.feth at honeywell.com wrote: > I'm using Mathematica 6.0 and when I use the following notebook entry > > Test=Table[{x,(1/2)+(Cos[2*2*Pi*x]/2)*(E^-(x^2)+(1/2)*0.1*E^- > ((x-12)^2)+(1/2)*0.05*E^-((x-27)^2)+(10^-3)*E^-((x-280)^2))}, > {x,-10,40,0.05}];ListPlot[Test,PlotRange->All,Joined->True,Frame- >> True,FrameLabel->{"Pathlength Mismatch (2\[CenterDot]m mm)"," Signal > Strength "},BaseStyle->{FontFamily->"Garamond",FontSlant- >> "Italic",FontSize->14}] > > in addtion to the plot I want, I get a horizontal line across the > whole plot at 0.2. This sort of artifact also appears occasionally in > Mathematica 5.1. > > Does anyone know why it appears? > > Does anyone know how to get rid of it? The horizontal line is the horizontal axis. Setting the option Frame to True does not turn off the display of the axes. You must set the option Axes to None as in the example below. (Note that the vertical axis is also drawn: if you look carefully at the plot from your example you will notice that the graph touches the top and bottom frames at x == 0; whereas in the example below there exists a small gap between the graph and the top and bottom frame. See http://homepages.nyu.edu/~jmg336/mathematica/spuriousaxes.pdf ) Test = Table[{x, 1/2 + (Cos[2*2*Pi*x]/2)*(E^(-x^2) + ((1/2)*0.1)/E^(x - 12)^2 + ((1/2)*0.05)/ E^(x - 27)^2 + 1/(10^3*E^(x - 280)^2))}, {x, -10, 40, 0.05}]; ListPlot[Test, PlotRange -> All, Joined -> True, Axes -> None, Frame -> True, FrameLabel -> {"Pathlength Mismatch (2\[CenterDot]m mm)", " Signal\nStrength "}, BaseStyle -> {FontFamily -> "Garamond", FontSlant -> "Italic", FontSize -> 14}] Regards, -- Jean-Marc