# Different colors of ticks in the same listplot

I have the following vector:

tn = {0.521084, 0.114895, 0.114895, 0.114895, 0.114895, 0.521084, 0.114895,
0.114895}


I would like to try a ListStepPlot such that tn[[1]] has a blue plotmarker, tn[[2;;5]] have red plotmarkers, tn[[6]] has a green plotmarker and, finally, tn[[7;;8]] have orange plotmarkers. How can I do this?

## 2 Answers

Changed answer to meet the meaning of the question.

First, divide oroginal list to sublists corresponding colors:

points = MapIndexed[{First@#2, #1} &, tn]


Now we can plot with different plot markers:

ListPlot[{{points[[1]]}, points[[2 ;; 5]], {points[[6]]},
points[[7 ;; 8]]}, PlotMarkers -> {Blue, Red, Green, Orange}]


The shapes and sizes of markers can also be adjusted: Style[\[FilledCircle], Blue, 20] instead of Blue etc.

• Soory, I would like to have different plotmarkers... Sep 13 '19 at 9:45
• @GaeP, I've edited answer. Does it now meet your request?
– Alx
Sep 13 '19 at 23:57
tn = {0.521084, 0.114895, 0.114895, 0.114895, 0.114895, 0.521084, 0.114895, 0.114895};
colors = {Blue, Red, Red, Red, Red, Green, Orange, Orange};
ListStepPlot[tn, Ticks -> {{#, #, {0.02, 0}, colors[[#]]} & /@ Range[8], Automatic}]