How to find the middle x in ANY plot in R using grconvertX?

Viewed 160

I'm wondering given ANY plot drawn using BASE R (i.e., without any layout() or mfcol() or mfrow()) (see below for an example), how can one find the "X" coordinate of a point that would be always exactly in the middle of that plot (suppose "Y" for the point is arbitrary)?

I think grconvertX is designed to do this but I'm not sure how it exactly works (I appreciate a good explanation on grconvertX) as it has many settings (see below).

plot(1, t = "n", log = "x")

mean( grconvertX(0:1, "user") )
mean( grconvertX(0:1, "nic")  )
mean( grconvertX(0:1, "nfc")  )
mean( grconvertX(0:1, "ndc")  )
mean( grconvertX(0:1, "npc")  )
mean( grconvertX(0:1, "device") )
1 Answers
Related