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 CenterFile Exchange 中查找有关 Colormaps 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by