Plotting Matrix Columns with Colorbar

2 ビュー (過去 30 日間)
T Matthew Evans
T Matthew Evans 2020 年 2 月 11 日
コメント済み: Walter Roberson 2020 年 2 月 13 日
I have an array that is long in one dimension and short in another, let's say 50 x 5000. Each of the 50 rows is a point in space and each of the 5000 columns is a time. I would like to plot isochrones as so:
X = 50;
T = 5000;
x = 0:X;
t = 0:T;
M = somefun(x,t);
plot(M(:,1234),x);
However, I would like to plot many irregularly- (logarithmically?) spaced columns and would like to color them with increasing time and provide a corresponding colorbar. I can think of several ways to brute-force this, but I suspect that there is a simple way that I am missing.
Any help will be greatly appreciated.
  2 件のコメント
Walter Roberson
Walter Roberson 2020 年 2 月 13 日
T Matthew Evans commented,
I posted this question under an alias that I do not really use. I have reformulated the question in a somewhat more complete way and re-posted under my preferred alias. I would like very much to delete this question, please. Thank you.
Walter Roberson
Walter Roberson 2020 年 2 月 13 日
T Matthew Evans:
Our policy is that questions that have received a meaningful volunteer attempt at an answer are not deleted or closed, not unless the question is abusive or not permitted by law. This policy is in place to respect the efforts of the volunteers.
You can post a link to the updated question.

サインインしてコメントする。

回答 (1 件)

KSSV
KSSV 2020 年 2 月 11 日
編集済み: KSSV 2020 年 2 月 11 日
How about this approach?
x = 0:.05:2*pi;
y = sin(x);
z = zeros(size(x));
col = x; % This is the color, vary with x in this case.
surf([x;x],[y;y],[z;z],[col;col],...
'facecol','no',...
'edgecol','interp',...
'linew',5);
colorbar
  3 件のコメント
KSSV
KSSV 2020 年 2 月 11 日
Give same value for each column and use surf.
Moe Szyslak
Moe Szyslak 2020 年 2 月 11 日
I'm not sure surf will get me what I want -- here's a cartoon of what I am looking for. Does this make sense?
Clipboard01.jpg

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by