0
$\begingroup$

How to change the x data/label units? typing "exam 1", "exam 2", "exam 3",... instead of 1, 2, 3, ...

notas = {{6.3, 5.2, 4.70, 8.70, 3.05}, {8.95, 6.25, 7.20, 8.20, 
   8.5}, {4.95, 2.15, 2.80, 3.70, 2.4}, {5.7, 4.6, 4.80, 3.85, 
   3.25}, {0.65, 0.3, 0.05, 0.10, 0.1}, {4.1, 1.7, 0.30, 0.10, 
   0.1}, {2.05, 1.05, 1.55, 0.20, 1.75}, {5.5, 6.6, 5.25, 8.10, 
   8.6}, {6.2, 7.5, 9.45, 6.30, 8.4}, {3.95, 4.35, 7.85, 5.90, 1.25}}

a = ListLinePlot[notas, ImageSize -> Large, 
  PlotStyle -> AbsoluteThickness[1.6], LabelStyle -> {20, Bold} , 
  AxesOrigin -> {1, 0}, 
  GridLines -> {{1, 2, 3, 4, 5, 6, 7, 8, 9}}]
$\endgroup$
2
  • 1
    $\begingroup$ Have a look at the documentation for Ticks. $\endgroup$ Feb 11, 2018 at 9:03
  • $\begingroup$ @b.gatessucks Tells me that "A tick position should be a number" $\endgroup$
    – Mika Ike
    Feb 11, 2018 at 9:05

1 Answer 1

0
$\begingroup$

You can directly specify each tick marks with specific labels by adding the following option in the plot command:

Ticks -> {
  {{1, "Exam 1"}, {2, "Exam 2"}, {3, "Exam 3"}, {4, "Exam 4"}, {5, "Exam 5"}},
  Automatic}

Note that the Automatic is there to manage the ticks on the $y$ axis.

Also note that the first tick is disappearing due to the positioning of the $y$ axis, which takes priority over it. This can potentially be avoided by switching to FrameTicks -> (*same*), Frame-> True.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.