how can i get the pixel color from a plot
6 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Benutzer Name
le 5 Sep 2018
Réponse apportée : Walter Roberson
le 5 Sep 2018
Hi,
I plot a few lines in a figure. Now I want to detect the position and color form every pixel in this figure. Is there any chance to get these. I now it works for images with
imread
Is there any function in Matlab to get these information if I have a plot?
(the following picture is just an example)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/195179/image.png)
0 commentaires
Réponse acceptée
Walter Roberson
le 5 Sep 2018
If what you have is something currently plotted on the screen, then you have a few choices. Probably the most convenient one is to getframe() to record the screen into a buffer and then process the resulting array.
Other possibilities including using saveas() or print() to save the screen to an image file, and then read in the image file and process the resulting array.
Another possibility includes using print() with -dmeta to record to the clipboard as a windows metadata file -- which could potentially be a vector format rather than a raster format. Processing this could potentially be a nuisance though.
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Printing and Saving 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!