how to shift a pcolor figure ?

조회 수: 6 (최근 30일)
Rabih Sokhen
Rabih Sokhen 2021년 3월 25일
댓글: Mathieu NOE 2021년 3월 26일
hello !
is their a way to shift a pcolor figure to the center?

답변 (1개)

Mathieu NOE
Mathieu NOE 2021년 3월 25일
yes for sure
% non centered plot
N = 21;
X = (1:N);
Y = (1:N);
C = rand(N,N);
figure(1),pcolor(X,Y,C)
colormap(gray(2))
axis ij
axis square
% centered plot
N = 10;
X = (-N:N);
Y = (-N:N);
C = rand(2*N+1,2*N+1);
figure(2),pcolor(X,Y,C)
colormap(gray(2))
axis ij
axis square
  댓글 수: 2
Rabih Sokhen
Rabih Sokhen 2021년 3월 25일
Thank you!
Mathieu NOE
Mathieu NOE 2021년 3월 26일
you're welcome

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Graphics Object Programming에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by