Format axes in plot

2 次查看(过去 30 天)
John Doe
John Doe 2013-5-21
Is it possible to color a single number (or a set of numbers) on one of the axes in Matlab?
Suppose I have a plot:
plot(1:10, rand(1,10))
Now, can I e.g. make the number 3 on the x-axis red?
Thanks!
  1 个评论
Hanif
Hanif 2013-5-21
try plot(1:10, rand(1,10), 'ForegroundColor','Red')
as for one number not too sure

请先登录,再进行评论。

回答(1 个)

Jan
Jan 2013-5-22
Searching in the FileExchange for "tick label" finds a lot of interesting methods, e.g. http://www.mathworks.com/matlabcentral/fileexchange/36254-ticklabelformat-set-a-dynamic-format-of-axes-tick-labels. This will not solve the problem directly, but it contains enough details.

类别

Help CenterFile Exchange 中查找有关 Axis Labels 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by