Conditional formating for certain points in plot

2 ビュー (過去 30 日間)
Catherine Mageeney
Catherine Mageeney 2018 年 1 月 13 日
回答済み: Darshan Ramakant Bhat 2018 年 1 月 16 日
I am very new to matlab. I have a data set with 12000 value that I have created a variable for. I have created a scatter plot. In this plot I would like to change all values above 1 to plot in one color and all values below -1 to a different color. How would you write the conditional statement for this? Thanks.
  1 件のコメント
per isakson
per isakson 2018 年 1 月 13 日
See the last example on page Plot Categorical Data

サインインしてコメントする。

回答 (1 件)

Darshan Ramakant Bhat
Darshan Ramakant Bhat 2018 年 1 月 16 日
Group the data set depending on the value. Then use the "hold on" option to do the scatter plot with different colors in the same figure.
You can specify the different colors using Name-Value properties in scatter(). Please refer the below document: https://www.mathworks.com/help/matlab/ref/scatter.html#input_argument_namevalue_d119e942892

カテゴリ

Help Center および File ExchangeScatter Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by