Error in resizing heatmaps in a subplotted figure
1 次查看(过去 30 天)
显示 更早的评论
Hello
When I run the following code
Frq_array = cellstr(string(3:38)); %(2:50));
fx = figure('MenuBar','none','Toolbar','none');
fx.WindowState = 'maximized';
for compo = 1:3
subplot(1,3,compo);
spec = squeeze(the_spectra(compo,:,:));
spec = spec';
switch compo
case 1
ylabel = ylabel_array;
this_title = 'Transverse';
case 2
ylabel = null_y_array;
this_title = 'Vertical';
case 3
ylabel = null_y_array;
this_title = 'Longitudinal';
end
%heatmap(Frq_array,ylabel,spec);
heatmap_new(spec,Frq_array,ylabel,[],'Colormap',chosen_colormap,'Gridlines',':'); %,'ShowAllTicks','true'); %'YlOrRd'); %'money'); %vte_colormap);
title(this_title);
end
where "heatmap_new" is the Customizable HeatMap by Ameya Deoras, I get the following error message, though the code works fine!
Unable to perform assignment because value of type 'string' is not convertible to 'cell'.
Error in heatmap_new>updateLabels (line 544)
ylabels(1:length(axInfo.ylab)) = axInfo.ylab;
Error in heatmap_new>resize (line 607)
updateLabels(hAxes(i), false);
Caused by:
Error using cell
Conversion to cell from string is not possible.
Error while evaluating Figure SizeChangedFcn.
Can I just disable this error? Or is it really something that I am not seeing?
Thanks,
Doug
0 个评论
采纳的回答
Walter Roberson
2022-9-6
Your ylabel_array or your null_y_array are string() arrays, which that File Exchange Contribution does not expect. You will need to change to cell array of character vectors.
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Distribution Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!