Changing chart border's color

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Changing chart border's color

Mahmood Naderan-Tahan
Hi

I would like to make the color of the chart border to black. However, the following command doesn't work


plot(res.pca, choix="ind", border="black")


Any way to fix that?

Regards,
Mahmood

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Changing chart border's color

Rasmus Liland-3
Hi,  it would be useful to know how you
created res.pca.  
https://rdrr.io/r/graphics/box.html

Rasmus

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Changing chart border's color

Mahmood Naderan-Tahan
Hi Rasmus,

Please see the following commands. The box fails.


> library("FactoMineR")
> mydata <- read.csv('test.csv', header=T,row.names=1)
> res.pca = PCA(mydata, quali.sup=5, graph=F)
> plot(res.pca, choix="ind")
> box(col='black')
Error in box(col = "black") : plot.new has not been called yet




Regards,
Mahmood

________________________________
From: Rasmus Liland <[hidden email]>
Sent: Tuesday, March 9, 2021 8:16:24 PM
To: Mahmood Naderan-Tahan
Cc: [hidden email]
Subject: Re: [R] Changing chart border's color

Hi,  it would be useful to know how you
created res.pca.
https://rdrr.io/r/graphics/box.html

Rasmus

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Changing chart border's color

Rasmus Liland-3
Please add test.csv using dput 🙃

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Changing chart border's color

Rasmus Liland-3
In reply to this post by Mahmood Naderan-Tahan
Right, adding a black border around a
plot in R is meaningless.  

There is also another circular plot
being created everytime FactoMineR::PCA
runs.  

It might be (perhaps, idk) fruitful for
you to look at the contents of res.pca
using str and create the PCA plot
yourself using ggplot2 ...  or maybe
plotly inside a shiny app ....

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

signature.asc (849 bytes) Download Attachment