how to shift a pcolor figure ?

9 ビュー (過去 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 Center および File ExchangeInteractive Control and Callbacks についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by