Can I club these 3 figures into 1?

Hello,

How can I club these 3 figures into 1? If someone can please help me with this.

Here is my code:

H <- c(1660, 944, 722, 412, 79)
par(mar=c(5,6,1,1)+.1)
barplot(H,
        xlab = "Frequency",
        ylab = "",
        names.arg = c("Abstract", "Texture", "Flavor", "Appearance", "Aroma"),
        col = grey.colors(5),
        horiz = TRUE, main="A: General", font.main=2, las=1, font.lab=1, font.axis=1, border = NA)

#2nd OEQ
H <- c(1240, 962, 343, 208, 16)
par(mar=c(5,6,1,1)+.1)
barplot(H,
        xlab = "Frequency",
        ylab = "",
        names.arg = c("Abstract", "Flavor", "Aroma", "Texture", "Appearance"),
        col = grey.colors(5),
        horiz = TRUE, main="B: A/F OEQ", font.main=2, las=1, font.lab=1, font.axis=1, border = NA)

#3rd OEQ
H <- c(1650, 1083, 72, 25, 0)
par(mar=c(5,6,1,1)+.1)
barplot(H,
        xlab = "Frequency",
        ylab = "",
        names.arg = c("Texture", "Abstract", "Flavor", "Appearance", "Aroma"),
        col = grey.colors(5),
        horiz = TRUE, main="C: Texture OEQ", font.main=2, las=1, font.lab=1, font.axis=1, border = NA)

Created on 2021-03-27 by the reprex package (v1.0.0)

Before you create the figures, run:

par(mfrow=c(1,3), mar=c(5,6,1,1)+.1)

The code above will create a layout that combines three figures in one row. For three figures in one column, do mfrow=c(3,1). mfrow can be used for basic layouts like these. For more complex layouts with base graphics (different sizes for each figure, for example), see the layout function. Also, you only need to run mar=c(5,6,1,1)+.1 once. You need to run it again only if you want to change the margins for the next figure.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.