When plotting, I usually want my axes labels placed where FrameLabel-
>{"x", "y"} puts them (underneath the plot for the x-axis label, and
written vertically to the left of the plot for the y-axis label). But
sometimes I don't want a rectangular frame around my plot, which is
what I get when I use Frame->True.
What's the best way to have FrameLabel-style axes labels while still
having regular old axes instead of a rectangular frame?
Cheers,
Andrew
> What's the best way to have FrameLabel-style axes labels while still
> having regular old axes instead of a rectangular frame?
>
don't know whether this fits your definition of best, but it looks easy
and does what I think you want:
Plot[x, {x, 0,1},
Frame -> {True, True, False, False},
FrameLabel -> {"x", "y"}
]
albert
>Hi,
>
>When plotting, I usually want my axes labels placed where FrameLabel-
>
>
>>{"x", "y"} puts them (underneath the plot for the x-axis label, and
>>
>>
>written vertically to the left of the plot for the y-axis label). But
>sometimes I don't want a rectangular frame around my plot, which is
>what I get when I use Frame->True.
>
>What's the best way to have FrameLabel-style axes labels while still
>having regular old axes instead of a rectangular frame?
>
>Cheers,
>Andrew
>
>
I don't know if this is possible in version 5.2, but with version 6 it's
easy. This is because plots are no longer side effects, and because of
the new function Labeled. For example:
Labeled[ Plot[Sin[x], {x, 0, 2 Pi}], {x, y}, {Bottom, Left}]
produces what you want.
Carl Woll
Wolfram Research
>When plotting, I usually want my axes labels placed where FrameLabel-
>>{"x", "y"} puts them (underneath the plot for the x-axis label, and
>written vertically to the left of the plot for the y-axis label).
>But sometimes I don't want a rectangular frame around my plot, which
>is what I get when I use Frame->True.
>What's the best way to have FrameLabel-style axes labels while still
>having regular old axes instead of a rectangular frame?
Take a look at the following:
In[1]:=
Plot[x, {x, 0, 1}, Frame -> {True, True, False, False},
FrameLabel -> {"x-axis", "y-axis"}];
--
To reply via email subtract one hundred and four
You can pass a list of arguments to the option Frame to tell Mathematica
where parts of the frame must be drawn. For instance,
In[1]:=
Plot[Sin[x], {x, 0, 2*Pi}, Frame ->
{True, True, None, None}, FrameLabel ->
{"x", "y"}];
Regards,
Jean-Marc
But it is well documentated in the new version. See here
http://reference.wolfram.com/mathematica/ref/Frame.html
Here are all possible combinations
In[20]:=
frs = Tuples[{True, False}, 4]
Out[20]=
{{True, True, True, True}, {True, True, True, False}, {True, True,
False, True}, {True, True, False, False},
{True, False, True, True}, {True, False, True, False}, {True, False,
False, True}, {True, False, False, False},
{False, True, True, True}, {False, True, True, False}, {False, True,
False, True}, {False, True, False, False},
{False, False, True, True}, {False, False, True, False}, {False,
False, False, True}, {False, False, False, False}}
And here are the respective graphs.
In[28]:=
(Plot[x, {x, -2, 2}, Axes -> False, PlotStyle -> Thickness[0.01],
Frame -> #1, PlotLabel -> ToString[#1]] & ) /@ frs;
Cheers
Dimitris
=CF/=C7 Andrew Moylan =DD=E3=F1=E1=F8=E5:
An old, pre-6.0 habit to unlearn: suppressing result "-Graphics-" output
by terminating graphics statements with semi-colons.
dimitris wrote:
> This setting of Frame option was undocumentated until now.
> (search in my archives for relevant questions of mine).
>
> But it is well documentated in the new version. See here
>
> http://reference.wolfram.com/mathematica/ref/Frame.html
>
> Here are all possible combinations
>
> In[20]:=
> frs = Tuples[{True, False}, 4]
>
> Out[20]=
> {{True, True, True, True}, {True, True, True, False}, {True, True,
> False, True}, {True, True, False, False},
> {True, False, True, True}, {True, False, True, False}, {True, False,
> False, True}, {True, False, False, False},
> {False, True, True, True}, {False, True, True, False}, {False, True,
> False, True}, {False, True, False, False},
> {False, False, True, True}, {False, False, True, False}, {False,
> False, False, True}, {False, False, False, False}}
>
> And here are the respective graphs.
>
> In[28]:=
> (Plot[x, {x, -2, 2}, Axes -> False, PlotStyle -> Thickness[0.01],
> Frame -> #1, PlotLabel -> ToString[#1]] & ) /@ frs;
>
> Cheers
> Dimitris
>
>
> =CF/=C7 Andrew Moylan =DD=E3=F1=E1=F8=E5:
--
Murray Eisenberg mur...@math.umass.edu
Mathematics & Statistics Dept.
Lederle Graduate Research Tower phone 413 549-1020 (H)
University of Massachusetts 413 545-2859 (W)
710 North Pleasant Street fax 413 545-1801
Amherst, MA 01003-9305