How to insert transparent background image behind several line plot?
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Teerapong Poltue
am 3 Jun. 2021
Beantwortet: Sulaymon Eshkabilov
am 3 Jun. 2021
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/641425/image.png)
I got several lines plot as shown above, and I would like to insert the image with transparent backgroud then set its transparency behind the plot. How I can do that? The expected result is attatched below.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/641430/image.png)
This is my current code for that
img = imread('P.png');
min_x = 0;
max_x = 0.8;
min_y = 0;
max_y = 3.5;
imagesc([min_x max_x], [min_y max_y], flipud(img));
set(gca,'ydir','normal');
But what I got from this code is pretty weird!
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/641435/image.png)
0 Kommentare
Akzeptierte Antwort
Sulaymon Eshkabilov
am 3 Jun. 2021
First, your display your image and then plot on top of that image, e.g.
x = imread('MYimage.jpg');
imshow(x),colormap jet
hold on
a = 1:25; b=a*2-3;
c= linspace(1, 5); d = sqrt(c+15);
plot(a,b,'r-o',c,d,'k--d')
good luck
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Convert Image Type finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!