how to plot multiple graph on top of images together?

조회 수: 2 (최근 30일)
DARSHAN KUMAR BISWAS
DARSHAN KUMAR BISWAS 2022년 7월 4일
댓글: DARSHAN KUMAR BISWAS 2022년 7월 5일
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
DGM
DGM 2022년 7월 4일
That's a remarkably vague description.
Are the images already in the workspace, or do they have to be generated/read?
What kind of plot? A line plot? A contour? A filled contour?
How is the plot aligned to the image?
How do you want to display them "together"? Do the plots share a similar domain and range such that you intend to display them in the same axes? Are they to go in separate axes? Do axes decorations matter, or is the goal to just create a montage?
DARSHAN KUMAR BISWAS
DARSHAN KUMAR BISWAS 2022년 7월 4일
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.

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

답변 (1개)

DGM
DGM 2022년 7월 4일
편집: DGM 2022년 7월 4일
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
DARSHAN KUMAR BISWAS
DARSHAN KUMAR BISWAS 2022년 7월 5일
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.

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

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by