Discussion:
axis label position
(too old to reply)
AM Cody
2009-04-15 08:59:55 UTC
Permalink
The default position for axis labels in Mathematica is at the end of the axes. However, I need to make a plot with the x-axis label below the x axis and the y-axis to the left (not at the top). Is there some axes label format specification that controls this?

So far, I have found two potential solutions, and neither of them are ideal:

-I can instead use Text[] to put a label at the location of my choosing and then use Show[] to show the plot and the label together. The problem with this is that the plot axes get extended to accomodate these new graphics objects (the labels). I just want an x and y axis that begin at the origin and extend to positive values. Showing the labels makes them extend to negative values as well, which isn't very astheticaly pleasing.

-What I want to do also seems possible with Frame, since FrameLabel produces the kinds of labels that I want.
But to use frame I need to suppress the upper and right parts (i.e., so that I'm left with just an x and y axis). The command for this: Frame->{{True,False},{True,False}}
does not seem to work on the version of Mathematica (5.2) installed on this computer system.

Is there an easier/cleaner way to do this?
Albert Retey
2009-04-16 08:16:24 UTC
Permalink
Post by AM Cody
The default position for axis labels in Mathematica is at the end of the axes. However, I need to make a plot with the x-axis label below the x axis and the y-axis to the left (not at the top). Is there some axes label format specification that controls this?
-I can instead use Text[] to put a label at the location of my choosing and then use Show[] to show the plot and the label together. The problem with this is that the plot axes get extended to accomodate these new graphics objects (the labels). I just want an x and y axis that begin at the origin and extend to positive values. Showing the labels makes them extend to negative values as well, which isn't very astheticaly pleasing.
-What I want to do also seems possible with Frame, since FrameLabel produces the kinds of labels that I want.
But to use frame I need to suppress the upper and right parts (i.e., so that I'm left with just an x and y axis). The command for this: Frame->{{True,False},{True,False}}
does not seem to work on the version of Mathematica (5.2) installed on this computer system.
Is there an easier/cleaner way to do this?
using the correct syntax (it might not be obvious but I think is
documented) will make the Frame solution work (on every version since at
least 4.2):

Plot[x, {x, 0, 1}, Frame -> {True, True, False, False},
FrameLabel -> {"x", "y"}]


hth,

albert
Bill Rowe
2009-04-16 08:18:42 UTC
Permalink
Post by AM Cody
The default position for axis labels in Mathematica is at the end of
the axes. However, I need to make a plot with the x-axis label below
the x axis and the y-axis to the left (not at the top). Is there
some axes label format specification that controls this?
<snip>
Post by AM Cody
-What I want to do also seems possible with Frame, since FrameLabel
produces the kinds of labels that I want. But to use frame I need to
suppress the upper and right parts (i.e., so that I'm left with just
Frame->{{True,False},{True,False}} does not seem to work on the
version of Mathematica (5.2) installed on this computer system.
Instead of Frame->{{True,False},{True,False}} try Frame->{True,False,True,F=
alse}
Bob Hanlon
2009-04-16 08:19:36 UTC
Permalink
Plot[x, {x, 0, 1},
Frame -> {True, True, False, False},
FrameLabel -> {"x", "y"},
Axes -> False]


Bob Hanlon

---- AM Cody <***@astro.caltech.edu> wrote:

=============
The default position for axis labels in Mathematica is at the end of the axes. However, I need to make a plot with the x-axis label below the x axis and the y-axis to the left (not at the top). Is there some axes label format specification that controls this?

So far, I have found two potential solutions, and neither of them are ideal:

-I can instead use Text[] to put a label at the location of my choosing and then use Show[] to show the plot and the label together. The problem with this is that the plot axes get extended to accomodate these new graphics objects (the labels). I just want an x and y axis that begin at the origin and extend to positive values. Showing the labels makes them extend to negative values as well, which isn't very astheticaly pleasing.

-What I want to do also seems possible with Frame, since FrameLabel produces the kinds of labels that I want.
But to use frame I need to suppress the upper and right parts (i.e., so that I'm left with just an x and y axis). The command for this: Frame->{{True,False},{True,False}}
does not seem to work on the version of Mathematica (5.2) installed on this computer system.

Is there an easier/cleaner way to do this?
David Park
2009-04-16 08:11:16 UTC
Permalink
I think that in Version 5.2 you can use Frame -> {True, True, False, False}.


David Park
***@comcast.net
http://home.comcast.net/~djmpark/


From: AM Cody [mailto:***@astro.caltech.edu]

The default position for axis labels in Mathematica is at the end of the
axes. However, I need to make a plot with the x-axis label below the x axis
and the y-axis to the left (not at the top). Is there some axes label format
specification that controls this?

So far, I have found two potential solutions, and neither of them are ideal:

-I can instead use Text[] to put a label at the location of my choosing and
then use Show[] to show the plot and the label together. The problem with
this is that the plot axes get extended to accomodate these new graphics
objects (the labels). I just want an x and y axis that begin at the origin
and extend to positive values. Showing the labels makes them extend to
negative values as well, which isn't very astheticaly pleasing.

-What I want to do also seems possible with Frame, since FrameLabel produces
the kinds of labels that I want.
But to use frame I need to suppress the upper and right parts (i.e., so that
I'm left with just an x and y axis). The command for this:
Frame->{{True,False},{True,False}}
does not seem to work on the version of Mathematica (5.2) installed on this
computer system.

Is there an easier/cleaner way to do this?

Continue reading on narkive:
Loading...