Is it possible to plot the image of a pdf file within subplot?

9 ビュー (過去 30 日間)
Yoni Verhaegen -WE-1718-
Yoni Verhaegen -WE-1718- 2023 年 1 月 22 日
回答済み: Daksh 2023 年 2 月 3 日
Hi all.
I have an image stored in a PDF file which I would like to display as a part of a subplot in Matlab (see attachment). Is this possible? Thanks!
  1 件のコメント
Jan
Jan 2023 年 1 月 22 日
What is the problem exactly? Displaying an image a subplot? This is solved by the image() command easily. Or extracting the image from the PDF? If so, should the be done automatically? If so, how can the page and position of the wanted image be identified? Or do you want to extract the image manually, e.g. by AcrobatPro or other software to process PDFs? Do you mean a screenshot of the PDF or do you want to import a diagram in vector format?
Please edit the question and add more details.

サインインしてコメントする。

回答 (1 件)

Daksh
Daksh 2023 年 2 月 3 日
It is my understanding that alongside MATLAB-created plots, you wish to put a PDF-contained image inside a plot layout created by subplot() method.
I'm assuming that you've already snipped the PDF portion of image of use as a file (eg. my_image.jpg) and saved it into the working directory. If not, proceed to use the Snipping Tool or any 3rd party screenshot and crop tool to save the image for use as a file.
Refer to this script for the next steps:
subplot(2,2,1)
x = linspace(0,10);
y1 = sin(x);
plot(x,y1)
title('Subplot 1: sin(x)')
subplot(2,2,2)
y2 = sin(2*x);
plot(x,y2)
title('Subplot 2: sin(2x)')
subplot(2,2,[3,4])
y3 = sin(4*x);
% use imshow() command that displays image for the given file path
imshow('my_image.jpg');
title('My Image')
This will yield the desired output, as showcased by you in the attached image. Hope this helps!

カテゴリ

Help Center および File ExchangeImages についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by