plotting of two datasets of different length with similar look as heatmaps/colormaps
1 回表示 (過去 30 日間)
古いコメントを表示
Hi guys,
I would like to make a plot similar to what I have sketched below. I have two data sets; crystal residues and simulation residues. The sets are not of equal length therefore the vectors aren't either. When one of the residues is present in both the crystal and the simulation, i would like a mark to be placed in front of them as illustrated with e.g. Leu 307. (I can see I misplaced the square at the y-axis Ile 296; it was meant to be at Tyr 292). I have copied some of the datasets and shown below.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/337789/image.png)
Residues present in the crystal:
SER 267
ASP 289
HIE 290
ILE 291
TYR 292
THR 297
THR 301
MET 304
LEU 307
Residues present in the simulation:
TYR 23
ARG 26
ASN 51
TRP 52
PRO 53
GLY 54
PHE 75
TYR 163
GLN 166
SER 167
SER 267
ILE 291
TYR 292
ILE 296
MET 304
LEU 307
I have tried to plot the two; plot(simulation,crystal), but I get the error
Error using tabular/plot
Too many input arguments.
Do any of you know how I can plot this in Matlab?
Best regards
0 件のコメント
回答 (1 件)
Chidvi Modala
2020 年 8 月 4 日
Hi,
The following piece of code might be of help to you
% This code can be optimized but it is elaborated for better understanding
crystal = {"LEU 307", 1;
"MET 304", 2;
"ILE 296", 3};
simulation = {"ASN 155", 1;
"LEU 307", 2;
"GLU 259", 3};
j =1;
for i= 1: length(simulation)
temp = find([simulation{i,1}] == [crystal{:,1}]);
if ~isempty(temp)
x(j) = i;
y(j) = temp;
j = j+1;
end
end
plot(x,y,'--gs',...
'LineWidth',2,...
'MarkerSize',20,...
'MarkerEdgeColor','g',...
'MarkerFaceColor',[.49 0.70 .63]) % You can set RGB values based on your requirement
xlim([0 length(simulation)]);
ylim([0 length(crystal)]);
xticks([1 2 3]);
yticks([1 2 3]);
xticklabels({'ASN 155','LEU 307','GLU 259'});
yticklabels({'LEU 307', 'MET 304', 'ILE 296'});
title('Interface Interactions Ec FOFO')
xlabel('MD Simulation (>80%)');
ylabel('Crystal')
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Weather and Atmospheric Science についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!