Plotting Grayscale from .csv with colorbar restriction
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Jaslyn Tan
le 24 Oct 2019
Réponse apportée : Jaslyn Tan
le 12 Nov 2019
Hi there,
Can anyone please help..? I have grayscale image data in a .csv file I need to plot. The values in the .csv are the z values that I wish to plot as an image, the x and y coordinates of the z values in the file represent the location of that pixel in the image.
I need to restrict the colorbar to say 0 to 0.5 to see the detail in the certain part of the image. Everything below 0 can be black, above 0.5 can be white, but I need 0-0.5 to be greyscale.
I have plotted using the following code but what I get is a mostly blank image.
Please can someone help? I attach the data and my plot.
filename = 'C:\\my data.csv';
M = csvread(filename)
J = contourf(M)
colormap gray
h = colorbar;
set(h, 'ylim', [0 0.5])
0 commentaires
Réponse acceptée
Plus de réponses (1)
Voir également
Catégories
En savoir plus sur Color and Styling dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!