tokami
tokami

Reputation: 35

How to save information from barplot() and not displaying the graph

I have a small question: let's assume I want to assign the positions of the x ticks of a barplot to a variable for plots later on, however the barplot should not be displayed in the graphical device. How can I assign without plotting?

mat = matrix(ncol=5,nrow=3,rnorm(n = 15))
mids = barplot(mat)

Thank you very much for your time and help!

Cheers, tokami

Upvotes: 1

Views: 422

Answers (1)

Konrad Rudolph
Konrad Rudolph

Reputation: 545985

For barplot, you can provide the plot = FALSE parameter:

mids = barplot(mat, plot = FALSE)

Upvotes: 1

Related Questions