0

What function is used to change plot figure location in R? I have a plot and it looks good, but I need to change the location of the plot, what function should I use? I generated the graph using:

df<-read.csv("./data/games.csv")
plot(df$cream_rating,df$charcoal_rating, pch=19, col=c("red","black", "green") [df.1$winner])
legend(x="topleft", legend = levels(df$winner), col=c("red","black","green"), pch=19)
options(repr.plot.width=9, repr.plot.height=9)
       rated    turns   victory_status  winner  increment_code  cream_rating     
       charcoal_rating  opening_name
       <lgl>    <int>   <fct>   <fct>   <fct>   <int>   <int>   <fct>
1      FALSE    13  outoftime   cream   15+2    1500    1191    Slav Defense: Exchange Variation
2      TRUE     16  resign  charcoal    5+10    1322    1261    Nimzowitsch Defense: Kennedy Variation
3       TRUE    61  mate    cream   5+10    1496    1500    King's Pawn Game: Leonardis Variation
4       TRUE    61  mate    cream   20+0    1439    1454    Queen's Pawn Game: Zukertort Variation
5       TRUE    95  mate    cream   30+3    1523    1469    Philidor Defense
6       FALSE   5   draw    draw    10+0    1250    1002    Sicilian Defense: Mongoose Variation
user432797
  • 593
  • 4
  • 13
  • 1
    That depends a lot on exactly what function you are using to make the plot and where you want to move it to. It's easier to help you if you include a simple [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input and desired output that can be used to test and verify possible solutions. – MrFlick Oct 03 '20 at 03:42
  • I updated the question @MrFlick, the graph shows on the left side, I want to change to the middle. – user432797 Oct 03 '20 at 04:04
  • So like change "topleft" to "top"? Is that what you want? Or "center"? Not sure what exactly you mean by "middle". – MrFlick Oct 03 '20 at 04:06
  • I want to move the whole figure itself, not the legend box, to the middle, it is showing on the left. – user432797 Oct 03 '20 at 17:02

0 Answers0