How to suplot 3 images (2D data) horizontally?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
I have 3 sets of 2D data that I would like to plot horizontally as part of one figure only. Here's the code:
clc; clear all;
load infinite;
load finite;
load gain;
% transpose matrix is not required
A1= log10(fs1);
A2= log10(fs2);
A3= log10(fs3);
subplot(1,3,1);p1=pcolor(ky*1e-6,f/1e12,A1);
xlabel('k_{\ity}({\mu}m^{-1})') ;
subplot(1,3,2);p2=pcolor(ky*1e-6,f/1e12,A2);
xlabel('k_{\ity}({\mu}m^{-1})') ;
subplot(1,3,3);p3=pcolor(ky*1e-6,f/1e12,A3);
xlabel('k_{\ity}({\mu}m^{-1})') ;
ylabel('{\itf} (THz)');
%colormap setting
shading interp;
colormap jet;%colormap need to be set to jet for Blue-yellow-red map
%colorbar setting
c = colorbar;
%labels the colorbar vertically as desired
set(get(c,'label'),'string','logscale');
c.TickLength=.056;
c.Units='pixel';
c.FontWeight='bold';
%font properties
FS='Fontsize';
fs=18;
FN='Fontname';
fn='Times New Roman';
set(findall(gcf,'type','axes'),FS,fs,FN,fn);
set(findall(gcf,'type','text'),FS,fs,FN,fn);
But for some reason the first two subplots are all blacked out:
![problem.jpg](https://www.mathworks.com/matlabcentral/answers/uploaded_files/254948/problem.jpeg)
What seems to be the issue here ? Also, the subfigures are really thin. I would like them to be the proper size for viewing ease. Also, I would like only one ylabel on the far left and one color bar on the far right. Can anyone help me please? I am new to Matlab.
TIA,
Zihad Azad
P.S.:The tables are attached herewith.
0 Kommentare
Antworten (2)
Siehe auch
Kategorien
Mehr zu Colormaps finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!