Plooting pcolor plot for multiple matrix
显示 更早的评论
Hi Guys,
I have 3 different huge matrix (as an example, in fact I have hundreds matrix), lets call it a1,a2,a3. I would like to plot them as pcolor. Each of them are positioned in a subplot. as you can see, it is pretty hectic to repeat the codes several times since I have hundreds of matrix. Is there any better way to do it? You can see my code below.
Thank you very much.
close all;
clear all;
clc
%call from ReadData script
ReadData;
disp ('2D view plotted')
%Plotting
rot_a1 = rot90(a1);
subplot (4,1,1)
figure (1);
pcolor(rot_a1); %plot raw data dari Tekscan to analyzed fooprint shape
set(gca,'fontsize',8);
caxis ([0 2000]); %Set up colorbar
x_range = 0:20:80;
set(gca,'XTick', x_range);
set(gca,'XTickLabel',num2cell(floor(x_range*5.08)));
y_range = 0:20:90;
set(gca,'YTick', y_range);
set(gca,'YTickLabel',num2cell(floor(y_range*5.08)));
colormap(jet (256));
ylabel('Longitudinal (mm)','fontsize',8);
xlabel('Lateral (mm)','fontsize',8);
shading('interp'); % control the color shading of the plot surface
% colorbar('horiz'); % plot a color bar
title('500 kPa, 10 kN','FontSize',9);
rot_a2 = rot90(a2);
subplot (4,1,2)
figure (1);
pcolor(rot_a2); %plot raw data dari Tekscan to analyzed fooprint shape
set(gca,'fontsize',8);
caxis ([0 2000]); %Set up colorbar
x_range = 0:20:80;
set(gca,'XTick', x_range);
set(gca,'XTickLabel',num2cell(floor(x_range*5.08)));
y_range = 0:20:90;
set(gca,'YTick', y_range);
set(gca,'YTickLabel',num2cell(floor(y_range*5.08)));
colormap(jet (256));
ylabel('Longitudinal (mm)','fontsize',8);
xlabel('Lateral (mm)','fontsize',8);
shading('interp'); % control the color shading of the plot surface
% colorbar('horiz'); % plot a color bar
title('500 kPa, 20 kN','FontSize',9);
rot_a3 = rot90(a3);
subplot (4,1,3)
figure (1);
pcolor(rot_a3); %plot raw data dari Tekscan to analyzed fooprint shape
set(gca,'fontsize',8);
caxis ([0 2000]); %Set up colorbar
x_range = 0:20:80;
set(gca,'XTick', x_range);
set(gca,'XTickLabel',num2cell(floor(x_range*5.08)));
y_range = 0:20:90;
set(gca,'YTick', y_range);
set(gca,'YTickLabel',num2cell(floor(y_range*5.08)));
colormap(jet (256));
ylabel('Longitudinal (mm)','fontsize',8);
xlabel('Lateral (mm)','fontsize',8);
shading('interp'); % control the color shading of the plot surface
% colorbar('horiz'); % plot a color bar
title('500 kPa, 30 kN','FontSize',9);
rot_a4 = rot90(a4);
subplot (4,1,4)
figure (1);
pcolor(rot_a4); %plot raw data dari Tekscan to analyzed fooprint shape
set(gca,'fontsize',8);
caxis ([0 2000]); %Set up colorbar
x_range = 0:20:80;
set(gca,'XTick', x_range);
set(gca,'XTickLabel',num2cell(floor(x_range*5.08)));
y_range = 0:20:90;
set(gca,'YTick', y_range);
set(gca,'YTickLabel',num2cell(floor(y_range*5.08)));
colormap(jet (256));
ylabel('Longitudinal (mm)','fontsize',8);
xlabel('Lateral (mm)','fontsize',8);
shading('interp'); % control the color shading of the plot surface
% colorbar('horiz'); % plot a color bar
title('500 kPa, 40 kN','FontSize',9);
1 个评论
KSSV
2016-8-11
What dimensions the matrices are? what is rot90? you need not to make that a huge attempt to plot it..it can be done with single plot command and a loop.
采纳的回答
更多回答(1 个)
Fiddin Ichwanul Alhaz
2016-10-27
0 个投票
1 个评论
MJ Thangaraj
2020-3-13
Hey Alhaz,
I'm currently working on Tekscan for tire-pavement intercation. Anyway I could contact you for a couple of question.
Thank you
类别
在 帮助中心 和 File Exchange 中查找有关 Networks 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!