MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Plot Question

  • To: mathgroup at smc.vnet.net
  • Subject: [mg67730] Re: [mg67719] Plot Question
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Thu, 6 Jul 2006 06:52:09 -0400 (EDT)
  • Reply-to: hanlonr at cox.net
  • Sender: owner-wri-mathgroup at wolfram.com

Use a Frame

f[x_]:=x+8;

Plot[f[x],{x,1,8},
    PlotRange->{{0,9},{8,16}},
    Frame->True,Axes->False,
    FrameLabel->{"\nx-Axis Label","y-Axis Label\n"},
    PlotLabel->"PLOT LABEL\n"];

Note the improvement if the PlotRange is extended slightly

Plot[f[x],{x,1,8},
    PlotRange->{{-0.2,9.2},{7.8,16.2}},
    Frame->True,Axes->False,
    FrameLabel->{"\nx-Axis Label","y-Axis Label\n"},
    PlotLabel->"PLOT LABEL\n"];

If you want to exclude some of the Frame:

Plot[f[x],{x,1,8},
    PlotRange->{{-0.2,9.2},{7.8,16.2}},
    Frame->True,Axes->False,
    FrameLabel->{"\nx-Axis Label","y-Axis Label\n"},
    PlotLabel->"PLOT LABEL\n",
    FrameStyle->{{Automatic},{Automatic},{White},{White}},
    FrameTicks->{Automatic,Automatic,None,None}];


Bob Hanlon

---- Bharat Bhole <bbhole at gmail.com> wrote: 
> 
> Hello All:
> 
> I have a 2-D Plot in which I want to restrict the display of y-axis from
> 8-16, and of x-axis from 0-9. I achieve this using
> 
> plot=Plot[function[x],{x,1,8}, PlotRange ->{{0,9},{8,16}},
> AxesOrigin->{0,8}].
> 
> Then I want to label the x and y-axes and this is where I am having trouble.
> I want the x-axis label to appear just below the x-axis (and not at the end
> of the axis, as option AxesLabel gives). So I use the Text command and
> define
> 
> labelX = Text["name-xaxis", {5,7}]
> 
> Then I use,
> 
> Show[ plot , labelX ]
> 
> This, however, does not show name-xaxis, which I suppose is because it is
> out of PlotRange specified in Plot command. If I modify the PlotRange in the
> Show[ ] command to say
> 
> Show[plot,labelX, PlotRange->{{0,9},{6,16}}]
> 
> then it shows the  name-xaxis, however, it also extends the y-axis line to
> y=5. How can I both, get the name to display and at the same time have the
> y-axis start at value 8.
> 
> Thanks in advance for your help.
> 
> Bharat.
> 
> 


  • Prev by Date: Re: Sturm-Liouville (eigenvalue/eigenfunction) problems
  • Next by Date: RE: Incomplete Gamma function
  • Previous by thread: RE: Plot Question
  • Next by thread: Re: Plot Question