Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #10875
| From | "djmpark" <djmpark@comcast.net> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: Axis Labels on Plots Using a Frame |
| Date | 2012-07-11 06:21 +0000 |
| Message-ID | <jtj61d$5od$1@smc.vnet.net> (permalink) |
| References | <7842051.135469.1341895329363.JavaMail.root@m06> |
| Organization | Time-Warner Telecom |
This problem also applies when Mathematica puts the frame labels too far
away from the frame. This is especially apparent on the x axis.
In any case, the solution is to make your own labels by drawing outside the
frame. To do this one uses two options: ImagePadding creates space to draw
and PlotRangeClipping -> False prevents Mathematica from clipping things you
draw that are outside the frame.
The following is an example using ListPlot.
ListPlot[Table[{Sin[n], Sin[2 n]}, {n, 50}],
PlotStyle -> AbsolutePointSize[5],
Epilog -> {Text[Style["x", 16], {1.2, -1.2}],
Text[Style["y", 16], {-1.15, 1.25}]},
Frame -> True,
PlotRange -> {{-1.1, 1.1}, {-1.1, 1.1}},
PlotRangeClipping -> False,
ImagePadding -> {{30, 40}, {30, 35}}]
It's a little more intuitive with the Presentations Application because
there you just draw one thing after another.
<< Presentations`
Draw2D[
{AbsolutePointSize[5],
ListDraw[Table[{Sin[n], Sin[2 n]}, {n, 50}]],
Text[Style["x", 16], {1.2, -1.2}],
Text[Style["y", 16], {-1.15, 1.25}]},
AspectRatio -> 0.6,
Frame -> True,
PlotRange -> 1.1,
PlotRangeClipping -> False,
ImagePadding -> {{30, 40}, {30, 35}}]
David Park
djmpark@comcast.net
http://home.comcast.net/~djmpark/index.html
From: Gregory Lypny [mailto:gregory.lypny@videotron.ca]
Hello everyone,
I added a frame as an option to a list plot, and my x and y axis labels
disappeared. So I used FrameLabel, but the labels were placed centred below
the x axis and centred beside the y axis. Is there any way I can get them
to appear at the end of the x axis, that is, the bottom right of the frame,
and the top left for the y?
Regards,
Gregory
Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread
Re: Axis Labels on Plots Using a Frame "djmpark" <djmpark@comcast.net> - 2012-07-11 06:21 +0000
csiph-web