Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #10875 > unrolled thread

Re: Axis Labels on Plots Using a Frame

Started by"djmpark" <djmpark@comcast.net>
First post2012-07-11 06:21 +0000
Last post2012-07-11 06:21 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Axis Labels on Plots Using a Frame "djmpark" <djmpark@comcast.net> - 2012-07-11 06:21 +0000

#10875 — Re: Axis Labels on Plots Using a Frame

From"djmpark" <djmpark@comcast.net>
Date2012-07-11 06:21 +0000
SubjectRe: Axis Labels on Plots Using a Frame
Message-ID<jtj61d$5od$1@smc.vnet.net>
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

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web