이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
How to determine the different colour in scatter plot?
조회 수: 3 (최근 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!오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 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 (한국어)