Multiple Images on one plot

2 vues (au cours des 30 derniers jours)
Wafa'a Shanti
Wafa'a Shanti le 22 Mai 2018
Commenté : Wafa'a Shanti le 22 Mai 2018
In an attempt to create another heatmap, I am not sure how to plot multiple data sets on one graph with image. I have tried to use 'hold on', 'hold(im.Parent)', and adding an xlim to create the graph, but all failed attempts. Do I have to create a for-loop in order to plot multiple data sets on one image I am creating?
Thank you.

Réponses (1)

Walter Roberson
Walter Roberson le 22 Mai 2018
You can use
hold on
If you want to plot the images in different positions, pass the XData and YData parameters to the image() call.
However, the image drawn last will hide any image underneath it completely unless you pass AlphaData to the image() call to enable transparency. Remember that the effects of AlphaData are cumulative, so if you had (say) two 50% transparent images underneath the top 50% transparent image, then the bottom image would be contributing only 1/8th to the final result, as if you had background/8 + bottom/8 + middle/4 + top/2
I do not think you are going to be able to construct a useful heatmap using this technique.
You might want to have a look in the File Exchange at https://www.mathworks.com/matlabcentral/fileexchange/31726-data-density-plot
  2 commentaires
Wafa'a Shanti
Wafa'a Shanti le 22 Mai 2018
I am not sure if the data density plot is what I am looking for. I have my x-axis set as the time, and y-axis as height, and am plotting temperatures for a given height. I used pcolor to graph another data set, however this time around the data errors if using pcolor because the data is not a matrix (and changing the data to a matrix does not work either). I would like to plot the data sets according to the time they are at. If image cannot create the map I want, is there another suggestion?
Wafa'a Shanti
Wafa'a Shanti le 22 Mai 2018
Ended up figuring out how to make it work. Created a twoX16 matrix with repeating values, corrected sizes and was able to create a pcolor graph. Thank you for your help.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Images 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!

Translated by