how to plot multiple graph on top of images together?

3 views (last 30 days)
Suppose there are multiple numbers of images and I have to plot graph over each one of them and display all of them together. How can I do it?
  2 Comments
DARSHAN KUMAR BISWAS
DARSHAN KUMAR BISWAS on 4 Jul 2022
the images need to be read.
It's a line plot.
the line separates two regions in the image.
like the image below there are multiple number of images with various length of the orange part.
I need to plot the black line on top of the image and display all the images together one after another.

Sign in to comment.

Answers (1)

DGM
DGM on 4 Jul 2022
Edited: DGM on 4 Jul 2022
This is an oversimplified example:
% a picture comes from somewhere
A = imread('peppers.png');
% some data comes from somewhere
x = linspace(0,2*pi,100);
y = sin(x);
% get data range
xrange = min(x)+[0 range(x)];
yrange = min(y)+[0 range(y)];
% display the image
hi = image(xrange,yrange,A); hold on
% display the plot
hp = plot(x,y,'c');
How exactly the plot and image need to be located/scaled with respect to each other is something you'll have to decide. If there are multiple images, read/create them and then plot them in subplots using a loop.
There are other examples of overlaying plots on images. Here is one using contourf():
  1 Comment
DARSHAN KUMAR BISWAS
DARSHAN KUMAR BISWAS on 5 Jul 2022
the images need to be read.
It's a line plot.
the line separates two regions in the image.
like the image below there are multiple number of images with various length of the orange part.
I need to plot the black line on top of the image and display all the images together one after another.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!

Translated by