Message Boards Message Boards

0
|
6699 Views
|
9 Replies
|
0 Total Likes
View groups...
Share
Share this post:
GROUPS:

The position of the Tiks

Is it possible to place the label's Ticks on the other side of the axis?

Sometimes the projections of the graph to the axes hide them.

Thank you

POSTED BY: Ernesto Espinosa
9 Replies

Yes, look at the documentation on Ticks > Scope > Ticks Styling. For example Plot[Cos[x], {x, 0, 10}, Ticks -> {{{Pi, 180 [Degree], {0, .5}}, {2 Pi, 360 [Degree], {.5, 0}}, {3 Pi, 540 [Degree], {0, .5}}}, {-1, 1}}]

POSTED BY: Gianluca Gorni

Thank you, but I want to put the label's ticks to the other side of the axes.

I have read the manual and other sites and I have not found the answer.

POSTED BY: Ernesto Espinosa

The position of the Tiks

POSTED BY: Ernesto Espinosa

Yes, try the following exaple:

Plot[x, {x, -2, 2}, 
 Ticks -> {{{-1, -1, {0, .05}}, {1, 1, {.05, 0}}}, {-1, 1}}]

You can do it programmatically:

pl = Plot[x, {x, -1, 1}]
originalTicks = AbsoluteOptions[pl, Ticks];
Show[pl, originalTicks /. {x_Real, v_, lngths_, sty_} :> {x, v, 
    Reverse[lngths], sty}]

There is something funny here, because Show[pl, originalTicks] gives different ticks than the original.

POSTED BY: Gianluca Gorni

Look in the next example how the lines cover the -1 on both axes (what i'm calling the labels of the ticks.)

I want to put both -1 (the labels) to the other side of the axes.

That's what i don't know how to do.

Thank you Gianluca

Attachments:
POSTED BY: Ernesto Espinosa

I don't know a way to change the position of ticks labels, but you can place Text labels wherever you want:

Plot[x, {x, -2, 2}, 
 Epilog -> {Text[-1, {-1, 0}, {0, -1.1}], Text[-1, {0, -1}, {-2, 0}], 
   Line[{{-1, 0}, {-1, -1}, {0, -1}}]}, 
 Ticks -> {{{-1, "", {0, .01}}, {1, 1, {.01, 0}}}, {{-1, ""}, 1}}]
POSTED BY: Gianluca Gorni

Thank you.

Apparently there is no solution to my question right now.

Best regards Gianluca.

POSTED BY: Ernesto Espinosa

In the cases when the axes and the ticks interfere with the content of the picture, we should consider using Frame->True instead, and perhaps turning the axes off altogether:

Plot[x, {x, -1, 1}, Axes -> False, Frame -> True]
POSTED BY: Gianluca Gorni
Posted 10 years ago

I found the following solution , I hope you find it useful

Show[Plot[x, {x, -2, 2}, Ticks -> None], 
 Graphics[Line[{{-1, 0}, {-1, -1}, {0, -1}}]], 
 Graphics[{Text["-1posx", {-1, 1/4}], Text["-1posy", {1/4, -1}]}]]

You can also continue using ticks,saludos profe.

POSTED BY: Luis Ledesma
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