I have reviewed the previous questions as described in Minor grid with solid lines & grey-color but It didn't help me solve my problem. My issue is entailed with xticks. I want my grid lines to appear at specific points on xaxis and some other grid lines to appear at different points with some different colors. Something like this:
plot(x,y,'--g')
set(gca,'Xcolor',[0 0 0],'Xtick',[12e3,14e3,18e3,23e3,30e3,37e3,57e3],
set(gca,'Xcolor',[0.5 0.9 0.5],'Xtick',[10e3 16 28e3]);
The problem is that the later xtick labels overwrites the previous ones. I'd like to retain the xlabels of the previous ones.
Best Answer
Create a 2nd axis.
Produces: