Gridlines in contour Plots
- To: mathgroup at smc.vnet.net
- Subject: [mg38473] Gridlines in contour Plots
- From: Ross Sean Civ AFRL/DELO <Sean.Ross at kirtland.af.mil>
- Date: Wed, 18 Dec 2002 01:54:21 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
I noticed that there are no Gridlines option in Contour graphics. I am kind of partial to Gridlines because it makes graphs a lot easier to read and get numbers from in hard copy. I decided to piggyback off of the automatic gridlines option in other 2-D graphics. I also added an optional color that the normal Gridlines option doesn't have. To use it, just put Epilog->gridlinestogo[{xlow,xhigh},{ylow,yhigh},optionalcolor] in your contour graphics plot. Clear[gridlinestogo]; gridlinestogo[{xlow_,xhigh_},{ylow_,yhigh_},color_:RGBColor[0.,0.,0.5]]:=Mod ule[{o,g,r}, o=AbsoluteOptions[ Plot[ (ylow xhigh - yhigh xlow )/(xhigh-xlow)+ (yhigh-ylow)/(xhigh-xlow) x, {x,xlow,xhigh}, Frame->True, GridLines->Automatic, DisplayFunction->Identity]]; g=GridLines/.o; g=g/.RGBColor[0.,0.,0.5]->color; r=PlotRange/.o; Join[ Map[{Sequence@@#[[2]],Line[{{#[[1]],r[[2,1]]},{#[[1]],r[[2,2]]}}]}&, g[[1]]], Map[{Sequence@@#[[2]],Line[{{r[[1,1]],#[[1]]},{r[[1,2]],#[[1]]}}]}&, g[[2]] ] ] ] Dr. Sean Ross AFRL/DELO 3550 Aberdeen Ave. SE building 761 Kirtland AFB, NM 87117 email: Sean.Ross at Kirtland.af.mil