2
$\begingroup$

Consider this code

ticks = StringJoin /@ 
 Map[ToString, RandomChoice[{a, 1, b, 2}, {64, 4}], {2}];

rotatedTicks = Rotate[#, Pi/2] & /@ ticks; 

numberedTicks  = Transpose[{Range[64], rotatedTicks}];

numbers = RandomReal[1, 64];

ListPlot[numbers, Filling -> Axis, Ticks -> {numberedTicks}, 
 ImageSize -> Large]

It produces an extra annoying tick on the y axis (122a in this run). How can I kill it?

enter image description here

$\endgroup$
3
  • 1
    $\begingroup$ Please don't treat ticks yourself, go see a doctor and get it removed :D (sry, couldn't resist) $\endgroup$
    – Sascha
    Commented Jul 16, 2016 at 19:33
  • $\begingroup$ If you do not want the Ticks on y-axis at all, just do Ticks -> {numberedTicks,None} or just use Automatic: Ticks -> {numberedTicks,Automatic} $\endgroup$
    – atapaka
    Commented Jul 16, 2016 at 19:40
  • $\begingroup$ This is explained in the first few lines under "Details" in the docs for Ticks. $\endgroup$
    – Michael E2
    Commented Jul 16, 2016 at 22:24

2 Answers 2

7
$\begingroup$

In this case, your Ticks apply to both the x and y axis. The only substitution that can be made using these tick rules is for the value 1 on your range.

To leave the y axis alone you can set the ticks to default or sub in your own new rules:

ListPlot[numbers, Filling -> Axis, 
 Ticks -> {numberedTicks, Automatic}, ImageSize -> Large]
$\endgroup$
2
$\begingroup$

Example

ListPlot[
  numbers,  
  Filling -> Axis, Ticks -> {numberedTicks, None}, ImageSize -> Large 
  ]

Note: numberedTicks as in original post.

Output

output

Reference

Ticks

$\endgroup$

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