在单个显示器中绘制几个jpeg图像 [英] Plotting several jpeg images in a single display
问题描述
我需要在单个组合显示(或画布?)中绘制和显示几个jpeg图像。例如,假设我有不同大小的图像{a,b,c,d} .jpg,我想在2x2网格中将它们绘制在一个页面上。能够为每个子图设置一个标题也是很好的。
I need to plot and display several jpeg images in a single combined display (or canvas?). For example, suppose I have images {a,b,c,d}.jpg, each of different size, and I would like to plot them on one page in a 2x2 grid. It would be also nice to be able to set a title for each subplot.
我一直在寻找解决方案,但无法找到怎么做它,所以任何想法都会有所帮助。我最好使用基于EBImage包的解决方案。
I've been thoroughly looking for a solution, but couldn't find out how to do it, so any ideas would really help. I would preferably use a solution that is based on the EBImage package.
推荐答案
有两种方法可以用基本图形函数排列几个图,即 par(mfrow = c(行,列))
(用整数替换 rows
和 columns
)和 layout(mat)
其中 mat
是一个矩阵,如矩阵(c(1,2,3) ,4))
。
如需了解更多信息,请参阅?par
,?layout
,尤其是 Quick-R:合并图表。
There are two ways how to arrange several plots with base graph functions, namely par(mfrow=c(rows,columns))
(substitute rows
and columns
with integers) and layout(mat)
where mat
is a matrix like matrix(c(1,2,3,4))
.
For further info see ?par
, ?layout
, and especially Quick-R: Combining Plots.
然而,由于您的问题是关于图像,我不知道它是否对您有所帮助。如果没有,我很抱歉误解你的问题。
However, as your question is about images I don't know if it helps you at all. If not, I am sorry for misinterpreting your question.
这篇关于在单个显示器中绘制几个jpeg图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!