RE: Plot
- To: mathgroup at smc.vnet.net
- Subject: [mg17008] RE: [mg16947] Plot
- From: "Ersek, Ted R" <ErsekTR at navair.navy.mil>
- Date: Sat, 10 Apr 1999 02:13:39 -0400
- Sender: owner-wri-mathgroup at wolfram.com
Bernd Brandt wrote: ---------------------- The Plot function allows one to change the thickness of lines, axes and ticks using PlotStyle, AxesStyle, and Ticks. I have some plots i want to print on an overhead sheet. The lines are too thin for this. Is there a way to increase the line thickness of all lines in the plot and extending the length of the ticks (otherwise the ticks become invisible) in one go? -------------------- As you noticed everything but changing the ticks marks is easy to do with options. To enlarge the tick marks I modified the code P.J. Hinton posted the other day. Note, I figured Bold text would also look better on transparencies, but you might take that part out. See my BoldPlot function below. (*-------------------*) In[1]:= enlargeTicks[grObj_Graphics]:= Module[{fulopts, tcklst}, fulopts = FullOptions[grObj]; tcklst = Ticks/.fulopts /. {loc_,lab_,len:{_,_},{a___,AbsoluteThickness[_],b___}}:> {loc, lab, 1.5*len,{a,AbsoluteThickness[2],c}}; grObj/.Graphics[prims_,(opts__)?OptionQ]:> Graphics[prims,Ticks->tcklst,opts] ] In[2]:= BoldPlot[f_,PlotRange_,opts___?OptionQ]:= Module[{gr,df}, df=DisplayFunction/.Flatten[{opts,Options[Plot]}]; gr=Plot[f,PlotRange, DisplayFunction->Identity, opts, PlotStyle->{AbsoluteThickness[2]}, AxesStyle->{AbsoluteThickness[2]}, TextStyle->{FontWeight->"Bold"} ]; Show[enlargeTicks[gr],DisplayFunction->df] ] (*------------------*) The line below will make a bold plot. In[3]:= BoldPlot[Sin[x],{x,0,4 Pi}]; ------------------ If you specify dashed lines or something like that they don't come out thick (see the next example). David Wagner book "Power Programming With Mathematica The Kernel" shows how you can change the default thickness Plot uses (without such problems). You could do the same with BoldPlot above if you want to perfect this program. In[4]:= BoldPlot[Sin[x],{x,0,4 Pi}, PlotStyle->Dashing[{0.02,0.02}] ]; ------------------- If you don't including the code discussed in David Wagner's book you can use the line below. In[5]:= BoldPlot[Sin[x],{x,0,4 Pi}, PlotStyle-> {AbsoluteThickness[2],Dashing[{0.02,0.02}]} ]; -------------------- Regards, Ted Ersek