現在この質問をフォロー中です
- フォローしているコンテンツ フィードに更新が表示されます。
- コミュニケーション基本設定に応じて電子メールを受け取ることができます。
How to determine the different colour in scatter plot?
2 ビュー (過去 30 日間)
古いコメントを表示
Ara
2012 年 12 月 13 日
Hi Everybody,
Could you please help me how I can show it with different color? refer to the below code? this code show in one color while I need to determine different satellite by different color.
17 件のコメント
Walter Roberson
2012 年 12 月 13 日
Why are you bothering to compute y, as you are not using it?
You are placing the circles in the same place each time, just with different sizes.
Ara
2012 年 12 月 13 日
編集済み: Walter Roberson
2012 年 12 月 13 日
Ok, thanks. But still the problem is they plot all of the in a same color.
hold on
scatter (longi, lati, s4_0*2500, 'r')
hold on
scatter (longi, lati, s4_0*2500, 'g')
still plot it in a same color. It shows 5 different separated circle plot and the interesting thing is plot the second color. I mean green one as if can noot read the first line.
Azzi Abdelmalek
2012 年 12 月 13 日
編集済み: Azzi Abdelmalek
2012 年 12 月 13 日
You are just erasing the previous scatter. What you can do is to scatter the biggest circle then the smallest
Walter Roberson
2012 年 12 月 13 日
You are plotting two circles of the same size at the same location. Only the second one is going to show up.
Ara
2012 年 12 月 17 日
編集済み: Ara
2012 年 12 月 17 日
Thank you both, but still was not able to plot it with different color. I have another question, how can I try making plots with different threshold values. Since Walter helped me how to plot a point for each x value to calculated. Then draw a circle around x point. But NOW I want to get ride of small circle and just draw a circle for x data greater than some threshold value. For ex., x >=0.2. Could you please help me how?
Walter Roberson
2012 年 12 月 17 日
idx = s4_0(1,:) >= 0.2;
scatter(longi(idx), lati(idx), s4_0(1,idx)*2500,'r');
Ara
2012 年 12 月 17 日
Thank you, Walter. This code is good but the plot shows the same size for all of the circle while I am sure the column include the range of data between 0.2 to 0.5 and I would like to show it this range by different radius of the circles. As for color plot, I try this code and plot it colourful which is nice but I am not sure is correct so I put it here if it's possible for you to check it please. This code shows different trajectory of satellite in different color but still don't know which color is for which satellite or (prn) since legend also just show one data. I would really appreciate for your help.
scatter(longi, lati, s4_0*2500,prn(:,1));
Ara
2012 年 12 月 19 日
Thank you, but the problem is when I use it both figure are same which means there is no different between min and max. You know, the data are huge so I am just try to get rid of the small circle and just show the biggest (range 0.2, 0.3 and 0.4) one that was why I think to put some threshold and I expected to have a figure with some circle at least 6 circles and of course with different radius that I can show in this figure the different location of the biggest and smallest circles. But the below code just show me the same size and still lots of circles. could you please help me again if its possible?
idx = s4_0(1,:) >= 0.2;
scatter(longi, lati, max (s4_0(1,:))*2500,prn);
figure;scatter (longi, lati, min (s4_0(1,:))*2500,prn);
Walter Roberson
2012 年 12 月 19 日
My previous code
idx = s4_0(1,:) >= 0.2;
scatter(longi(idx), lati(idx), s4_0(1,idx)*2500,'r');
does use different radius of the circle. The s4_0(1,idx)*2500 expression is in the point-size parameter location, and the idx is selecting only those locations with the minimum radius.
But are you sure that the min() and max() are the same value ? Please show
format long g
min(S4_0(1,:))
max(S4_0(1,:))
Ara
2012 年 12 月 19 日
Yes, exactly same value...Do you remembered I upload a figure that shows some circle with different radius and it was about 6 circles. But in my data shows many many circles and when I show the point of each circle they look as if line so I prefer to reduce it and make the figure more clear.
ans =
0.0688228888887992
ans =
0.0688228888887992
Walter Roberson
2012 年 12 月 19 日
If all of your values are the same, then what value should be used to figure out the size of the circle? Or are the values just all the same for each column, but different between the columns? Are all the values in any one column certain to be the same?
Ara
2012 年 12 月 19 日
All the value are just for one column (one day data). Just imagine one column with different values and it might just 5 values (may one 0.2 and two 0.3 and two 0.4) in one column which are important to show.So I want to show by circle to clarify the exact value.I am also wondering cause when I plot it without threshold, it shows me some circles with different sizes so I want to extend it for whole month and I need to reduce extra circle just the significant one is important to me.
Walter Roberson
2012 年 12 月 19 日
I am confused.
Oh wait, row vs column. S4_0(1,:) is a row, not a column. Okay, so are all the values for one row the same, but the values might differ between rows??
Ara
2012 年 12 月 19 日
Sorry to make you confused. I am work just with column not row.I want Matlab read column s4 which I wrote and show different value by circle.
data=xlsread('1615_0.xls');
data_filterr=find(data(:,25)>60);
data_filtered=data(data_filterr,:);
elev_cutof20=find(data_filtered(:,6)>30);
data_cutoff15=data_filtered(elev_cutof20,:);
r=data_cutoff15(:,2);
time=(r./3600)-(24*0);
s4r=data_cutoff15(:,8);
s4cor=data_cutoff15(:,9);
s4=sqrt(s4r.^2-s4cor.^2);
Walter Roberson
2012 年 12 月 19 日
I'm not sure how s4_0 fits into this? Your s4 here would be a single column, but your s4_0 in your previous code was multiple columns.
Presuming that lati and longi are filtered the same way as data_filter, then it looks like you would want
idx = s4 >= 0.2;
scatter(longi(idx), lati(idx), s4(idx)*2500,'r');
Ara
2012 年 12 月 19 日
Thank you. It works. Just please let me ask another question regarding to different color. Assume all are filtered the same way. Each PRN in the column has different value and repeated by time and s4 column relevant to those number. I mean PRN shows number of satellite and I want to determine the circle by color to show come from which number. PRN=data_cutoff15(:,3);
採用された回答
Walter Roberson
2012 年 12 月 19 日
Are the PRN numbers simple integers such as 1, 2, 3, 4, 5, 6 ?
numsat = max(PRN);
cmap = jet(numsat); %use any handy colormap
idx = s4 >= 0.2;
scatter(longi(idx), lati(idx), s4(idx)*2500, cmap(PRN(idx),:) );
1 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Graphics Performance についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!エラーが発生しました
ページに変更が加えられたため、アクションを完了できません。ページを再度読み込み、更新された状態を確認してください。
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom(English)
アジア太平洋地域
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)
