Multiple Images on one plot

조회 수: 2 (최근 30일)
Wafa'a Shanti
Wafa'a Shanti 2018년 5월 22일
댓글: Wafa'a Shanti 2018년 5월 22일
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.

답변 (1개)

Walter Roberson
Walter Roberson 2018년 5월 22일
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
Wafa'a Shanti
Wafa'a Shanti 2018년 5월 22일
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 2018년 5월 22일
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.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Images에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by