Borrar filtros
Borrar filtros

how to show P-values in correlation map?

20 visualizaciones (últimos 30 días)
Vedanta
Vedanta el 13 de Feb. de 2024
Comentada: Hassaan el 13 de Feb. de 2024
Hello,
I have generated two maps by using corrcoef function, one is correlation map and second one is pvalue map. Now, I want to highlight (with dots) those pixels in correlation map which is having pvalue value less than 0.05. I have tried with stipples function but it is show some error. Is there any other way?
Thanks

Respuesta aceptada

Hassaan
Hassaan el 13 de Feb. de 2024
% Example data for demonstration
% Replace these with your actual corrMap and pValueMap variables
corrMap = rand(100); % 100x100 matrix of correlation values
pValueMap = rand(100); % 100x100 matrix of p-values
% Display the correlation map
imagesc(corrMap);
colormap('jet'); % Use a colormap of your choice
colorbar;
title('Correlation Map with Significant P-values Highlighted');
xlabel('X-axis Label');
ylabel('Y-axis Label');
% Hold on to overlay the dots
hold on;
% Get the indices where p-value is less than 0.05
[rows, cols] = find(pValueMap < 0.05);
% Overlay dots at these positions
% 'wo' stands for white circle, change the color/marker as needed
plot(cols, rows, 'wo', 'MarkerSize', 4);
% Hold off if you're done plotting
hold off;
-----------------------------------------------------------------------------------------------------------------------------------------------------
If you find the solution helpful and it resolves your issue, it would be greatly appreciated if you could accept the answer. Also, leaving an upvote and a comment are also wonderful ways to provide feedback.
It's important to note that the advice and code are based on limited information and meant for educational purposes. Users should verify and adapt the code to their specific needs, ensuring compatibility and adherence to ethical standards.
Professional Interests
  • Technical Services and Consulting
  • Embedded Systems | Firmware Developement | Simulations
  • Electrical and Electronics Engineering
Feel free to contact me.
  2 comentarios
Vedanta
Vedanta el 13 de Feb. de 2024
wow this works like charm, thanks @Hassaan
Hassaan
Hassaan el 13 de Feb. de 2024
@Vedanta You are welcome.
-----------------------------------------------------------------------------------------------------------------------------------------------------
If you find the solution helpful and it resolves your issue, it would be greatly appreciated if you could accept the answer. Also, leaving an upvote and a comment are also wonderful ways to provide feedback.
It's important to note that the advice and code are based on limited information and meant for educational purposes. Users should verify and adapt the code to their specific needs, ensuring compatibility and adherence to ethical standards.
Professional Interests
  • Technical Services and Consulting
  • Embedded Systems | Firmware Developement | Simulations
  • Electrical and Electronics Engineering
Feel free to contact me.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Spectral Measurements en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by