목록분류 전체보기 (49)
자료 매번 검색하기 귀찮아서 만든 블로그

t=1:10; y=rand(10,1); plot(t,y) CI = 0.5; t_CI = [t, fliplr(t)]; y_CI = [(y-CI)', fliplr((y+CI)')]; plot(t,y) hold on fill(t_CI, y_CI, 1) 색상, 투명도, 선 색깔 지정 plot(t,y) hold on fill(t_CI, y_CI, 1, 'facecolor', 'red', 'edgecolor', 'none', 'facealpha', 0.25)
a=rand(10^6,1); % 2.5분위수 반환 prctile(a, 2.5) ans = 0.0250 % 2.5분위수와 97.5분위수 반환 prctile(a, [2.5 97.5]) ans = 0.0250 0.9751 % n by m 행렬에 대해서도 적용이 된다 b = rand(10^6,2); prctile(b, [2.5 97.5]) ans = 0.0252 0.0248 0.9751 0.9749

$x= \begin{cases} 1 & \mbox{if a=1} \\ 2 & \mbox{if a=2} \\ 3 & \mbox{if a=3} \end{cases} $

그림은 그리되, 범례를 넣고싶지 않은 그림이 있을 때 사용 plot(...., 'HandleVisibility', 'off') 예시 a, b, c = rand(10, 1), rand(10, 1), rand(10, 1); t=1:10; plot(t,a) hold on plot(t, b) plot(t, c) yline(0.5) legend('Fontsize',25) 만약 여기서 yline(0.5) (data4)의 범례를 제거하고 싶으면, plot(t,a) hold on plot(t, b) plot(t, c) yline(0.5, 'HandleVisibility','off') legend('Fontsize',25) 끝

library(ggplot2) data = data.frame(Value=runif(5), Category=c(1:5)) ggplot(data, aes(Category, Value))+ geom_bar(stat='identity') library(gridExtra) data = data.frame(Value=runif(8), District = c("District1","District2", "District1","District2", "District1","District2", "District1","District2"), Phase=c(rep("Phase1", 2), rep("Phase2", 2), rep("Phase3", 2), rep("Phase4", 2))) g1

scale_color_manual은 카테고리 별로 데이터 색상을 지정할 때 사용한다. library(ggplot2) a