1

我只想在颜色条上绘制大于或等于 6 且小于或等于 12 的数据。我写了以下内容。但我无法包括其他限制:

scatter(x(log_gnd>=6), y(log_gnd>=6), 5, log_gnd(log_gnd>=6));

我还想将颜色条分成 4 段。

4

1 回答 1

1

Plot data points greater than or equal to 6 and lower than or equal to 12 (and function reference).

indices = log_gnd>=6 & log_gnd<=12;    
scatter(x(indices), y(indices), 5, log_gnd(indices));

Concerning the division of colorbar into 4 segments, following code divides colorbar with labels. If you would like for numbers to be there remove 'YTickLabel', {'First', 'Second', 'Third'} from the code.

colorbar('YTick', [7.5 9 10.5], 'YTickLabel', {'First', 'Second', 'Third'});
于 2012-11-08T18:08:15.840 回答