Message Boards Message Boards

0
|
247056 Views
|
4 Replies
|
3 Total Likes
View groups...
Share
Share this post:

[?] Modify OX labels output format?

Hello! I want to plot a simple function, but on the OX axis, the output labels are by default 1,2,3, etc. I want to have them in the format x/2. Instead of 1,2,3, I want 2/2, 4/2, 6/2. Is this possible? But only on the OX axis.

Thank you in advance!

POSTED BY: Robert Poenaru
4 Replies

Hello Robert,

A possible initial code may be the following:

Plot[x^2, {x, 1, 10}, Ticks -> {Range[20]/2, All}, 
 AxesLabel -> {HoldForm[x/2], HoldForm[y]}]

enter image description here

Sure, you may adjust and improve it.

O zi buna in continuare :)

Thank you very much sir! I will try it right away.

Toate cele bune :)

POSTED BY: Robert Poenaru

Have a look at the documentation of Ticks and Frameticks. You can specify ticks at any location with any labelÂ…

POSTED BY: Sander Huisman

Sorry Sander for the duplication. Your comment appeared only after I posted mine.

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