Message Boards Message Boards

2
|
9490 Views
|
2 Replies
|
4 Total Likes
View groups...
Share
Share this post:

Move axes labels up/down and left/right

Posted 11 years ago
Hi,

I have a question as to how to move the axes labels of the following chart, up/down and left/right
Plot[Sin[x], {x, -5, 5}]
For example, the x-axis labels occur under the x-axis, how can this be moved to be above the x-axis?
Likewise, the y-axis labels occur to the left of the axis, how can this be moved to be to the right of the y-axis?

Thanks!
Priyan.
POSTED BY: Priyan Fernando
2 Replies
Posted 11 years ago
Thanks for this! I'm surprised it is relatively hard to do. Thanks again,
Priyan.
POSTED BY: Priyan Fernando
There doesn't seem to be any easy way, but everything's possible:
p = Plot[Sin[x], {x, -5, 5}];
Show[FullGraphics[p], ImageSize -> 500,
  AspectRatio -> 1/GoldenRatio] /. {
   Text[t_, p_, {0., 1.}] :> Text[t, {p[[1]], p[[2]] + .1}, {0, -1}],
   Text[t_, p_, {1., 0.}] :> Text[t, {p[[1]] + .25, p[[2]]}, {-1, 0}]
  }


But from what I've read (and according to this quick test) FullGraphics isn't considered to be a reliable and problem-free Mathematica function. The tick marks have shrunk a bit, for example...
POSTED BY: C ormullion
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract