MathGroup Archive 1996

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

Search the Archive

Re: AxesLabels question

  • To: mathgroup at smc.vnet.net
  • Subject: [mg4003] Re: AxesLabels question
  • From: ianc (Ian Collier)
  • Date: Tue, 14 May 1996 02:38:47 -0400
  • Organization: Wolfram Research, Inc.
  • Sender: owner-wri-mathgroup at wolfram.com

In article <4ms4qt$58v at dragonfly.wolfram.com>, "The Brewer"
<jj8a at faraday.clas.virginia.edu> wrote:

> I am trying to show a ListPlot and a Plot output on he same
> graph.  The following code does it.  But when I try to put
> labels on the axes the labels dont show up.
> 
> 
> fig1=Plot[ans[x],{x,0,2},
>                           Frame->True, Axes->False,
>                           AspectRatio->1, PlotRange->All,
>                           PlotLabel->pltxt2,
>                           DisplayFunction->Identity];
> fig2=ListPlot[data,
>                           Frame->True, Axes->False,
>                           AspectRatio->1, PlotRange->All,
>                           DisplayFunction->Identity];
> 
> Show[fig1,fig2,DisplayFunction->$DisplayFunctionn]
> 
> 
> This part works.
> 
> I then tried the following:
> 
> 
> xlab=FontForm[ ToString[Concentration  mM],{"Helvetica",12}]
> 
> ylab=FontForm[ ToString[Relaxation Rate  s Superscript[-1]]
>                                 ,{"Helvetica",12}]
> 
> and added AxesLabel->{xlab.ylab} as an option to the plot
> commnad.  But the labels dont show up on the resulting graph.
> Can someone help me out here.
> 
> Also can someone tell me how to chenge the font of the values
> on the axes.
> 
> Thanks
> Jason
> 


The AxesLabel option does not work because you have set 
Axes-> False. Since you have set Frame -> True you can however
use the FrameLabel option to create the labels you want.

To change the font for the Tick mark labels (and the default for 
entire plot) you can use the DefaultFont option.

Here is an example, based on your code, to illustrate both of
these options.


In[44]:=
    ans[x_] := Sin[x]

In[45]:=
    data = Table[ {x,Cos[x]}, {x, 0, 2, .3}];

In[46]:=
    xlab=FontForm[ ToString[Concentration  mM],{"Helvetica",12}];

In[47]:=
    ylab=FontForm[ ToString[Relaxation Rate  s Superscript[-1]]
                                ,{"Helvetica",12}];

In[48]:=
    fig11=Plot[ans[x],{x,0,2},
                          Frame->True, Axes->False,
                          AspectRatio->1, PlotRange->All,
                          PlotLabel->pltxt2,
                          FrameLabel->{xlab,ylab},
                          DisplayFunction->Identity];

In[49]:=
    fig22=ListPlot[data,
                          Frame->True, Axes->False,
                          AspectRatio->1, PlotRange->All,
                          DisplayFunction->Identity];

In[50]:=
    Show[fig11,fig22,DisplayFunction->$DisplayFunction]
Out[50]=
    -Graphics-

In[51]:=
    ?DefaultFont
    DefaultFont is an option for graphics functions which
       specifies the default font to use for text. DefaultFont
       -> {"font", size} specifies the name and size of the font
       to use. The default setting is DefaultFont :>
       $DefaultFont.

In[52]:=
    Show[fig11,fig22,
            DefaultFont -> {"Helvetica",12},
            DisplayFunction->$DisplayFunction]
Out[52]=
    -Graphics-

I hope this helps.

--Ian

-----------------------------------------------------------
Ian Collier
Wolfram Research, Inc.
-----------------------------------------------------------
tel:(217) 398-0700   fax:(217) 398-0747    ianc at wolfram.com
Wolfram Research Home Page:         http://www.wolfram.com/
-----------------------------------------------------------

==== [MESSAGE SEPARATOR] ====


  • Prev by Date: Re: multinomials: a programming question
  • Next by Date: Re: Lists
  • Previous by thread: graphics cell color
  • Next by thread: AxesLabels question