I would like to mark the Minima of my colormap (scatter plot), because the Minima is not directly apparent.

1 回表示 (過去 30 日間)
%% Plot of the colormap %%
scatter(ff_r,ff_g,10,log10(save),'filled')
xlabel('Fill Factor RED [%]');
ylabel('Fill Factor Green [%]');
grid minor; xlim([0, 100]); ylim([0, 100]);
c = colorbar('eastoutside')
c.Label.String = 'Leistung: log_{10}(P) in [W/m^2]';
axis square;
colormap(cool(17))
how can I extra mark the Minima, for example with e red circle or crose...
I googled for help and found:
set(c, 'Ticks', sort([c.Limits, c.Ticks]))
But I would like to mark the minima and not the Ticks (whatever that should be..).

回答 (1 件)

Voss
Voss 2022 年 5 月 13 日
編集済み: Voss 2022 年 5 月 13 日
% some random data for demonstration:
ff_r = 100*rand(50,1);
ff_g = 100*rand(50,1);
saved_data = rand(50,1);
plotted_data = log10(saved_data);
% mark each point where plotted_data is at its minimum value
% with a red cross:
idx = plotted_data == min(plotted_data);
plot(ff_r(idx),ff_g(idx),'r+','LineWidth',1.5,'MarkerSize',8)
hold on
scatter(ff_r,ff_g,10,plotted_data,'filled')
xlabel('Fill Factor RED [%]');
ylabel('Fill Factor Green [%]');
grid minor; xlim([0, 100]); ylim([0, 100]);
c = colorbar('eastoutside');
c.Label.String = 'Leistung: log_{10}(P) in [W/m^2]';
axis square;
colormap(cool(17))

カテゴリ

Help Center および File ExchangeColormaps についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by