Try this pdf("~/graph.pdf") par(mar=c(8, 4, 4, 2)) barplot(d2, legend= c("SYCL", "CUDA"), beside= TRUE,las=2,cex.axis=0.7,cex.names=0.7,ylim=c(0,80), col=c("#9e9ac8", "#6a51a3")) dev.off()
See ?par to see the details for adjusting margins and other plot features. David On Tue, Jun 13, 2023 at 5:20 PM Ana Marija <sokovic.anamar...@gmail.com> wrote: > Thank you so much David, here is correction: d1=suppressWarnings(read. > csv("/Users/anamaria/Downloads/B1. csv", stringsAsFactors=FALSE, > header=TRUE)) d1$X <- NULL d2=as. matrix(sapply(d1, as. numeric)) > pdf("~/graph. pdf")b<-barplot(d2, > ZjQcmQRYFpfptBannerStart > This Message Is From an External Sender > This message came from outside your organization. > > ZjQcmQRYFpfptBannerEnd > Thank you so much David, here is correction: > > d1=suppressWarnings(read.csv("/Users/anamaria/Downloads/B1.csv", > stringsAsFactors=FALSE, header=TRUE)) > d1$X <- NULL > d2=as.matrix(sapply(d1, as.numeric)) > pdf("~/graph.pdf") > b<-barplot(d2, legend= c("SYCL", "CUDA"), beside= > TRUE,las=2,cex.axis=0.7,cex.names=0.7,ylim=c(0,80), col=c("#9e9ac8", > "#6a51a3")) > dev.off() > > > dput(head(d1)) > structure(list(Domain.decomp. = c("2. 1", "2"), DD.com..load = c(0L, > 0L), Neighbor.search = c("3.7", "3. 1"), Launch.PP.GPU.ops. = c("0. 1", > "0"), Comm..coord. = c("1 .6", "1 .0"), Force = c("1 . 5", "1 .2" > ), Wait...Comm..F = c("1 .3", "1 .7"), PIE.mesh = c(65.6, 70.9 > ), Wait.Bonded.GPU = c(0L, 0L), wait.GPU.NB.nonloc. = c(0L, 0L > ), Wait.GPU.NB.local = c(0L, 0L), NB.X.F.buffer.ops. = c(7.3, > 4.4), Write.traje = c(0.3, 0.3), Update = c(6.3, 4.3), Constraints = > c(8.9, > 9.7), Comm..energies = c(0.9, 0.9), PIE.redist..X.F = c("8. 1", > "8.7"), PIE.spread = c(29.7, 30.6), PIE.gather = c("19.9", "21 .3" > ), PIE.3D.FFT = c(6, 8.6), PIE.3D.FFT.comm. = c("1 .2", "1 .0" > ), PIE.solve.Elec = c(0.7, 0.5)), row.names = 1:2, class = "data.frame") > > Now my problem is that when I save my plot as PDF my labels on X axis are > cut off. Any advice about that? > > > > On Tue, Jun 13, 2023 at 5:14 PM David Carlson <dcarl...@tamu.edu> wrote: > >> Your first data column appears to contain character data (e.g. SYCL) which >> cannot be converted to numeric. You also appear to have 0's in the numeric >> columns which will cause problems since log(0) is -Inf. Barplots are useful >> for categorical data, but not continuous, numeric data which are better >> handled with box plots or strip charts. >> >> Do not use printouts of your data since it hides important information. >> Use str(a11) and dput(a11) or dput(head(a11)) to provide useful information >> about your data. >> >> David L Carlson >> Texas A&M University >> >> >> On Tue, Jun 13, 2023 at 4:08 PM Ana Marija <sokovic.anamar...@gmail.com> >> wrote: >> >>> Hello, I have a data frame like this: d11=suppressWarnings(read. >>> csv("/Users/anamaria/Downloads/B1. csv", stringsAsFactors=FALSE, >>> header=TRUE)) > d11 X Domain. decomp. DD. com. . load Neighbor. search >>> Launch. PP. GPU. ops. Comm. . coord. 1 SYCL 2. 1 >>> ZjQcmQRYFpfptBannerStart >>> This Message Is From an External Sender >>> This message came from outside your organization. >>> >>> ZjQcmQRYFpfptBannerEnd >>> >>> Hello, >>> >>> I have a data frame like this: >>> >>> d11=suppressWarnings(read.csv("/Users/anamaria/Downloads/B1.csv", >>> stringsAsFactors=FALSE, header=TRUE)) >>> >>> > d11 >>> X Domain.decomp. DD.com..load Neighbor.search Launch.PP.GPU.ops. >>> Comm..coord. >>> 1 SYCL 2. 1 0 3.7 0. 1 >>> 1 .6 >>> 2 CUDA 2 0 3. 1 0 >>> 1 .0 >>> Force Wait...Comm..F PIE.mesh Wait.Bonded.GPU wait.GPU.NB.nonloc. >>> 1 1 . 5 1 .3 65.6 0 0 >>> 2 1 .2 1 .7 70.9 0 0 >>> Wait.GPU.NB.local NB.X.F.buffer.ops. Write.traje Update Constraints >>> Comm..energies >>> 1 0 7.3 0.3 6.3 8.9 >>> 0.9 >>> 2 0 4.4 0.3 4.3 9.7 >>> 0.9 >>> PIE.redist..X.F PIE.spread PIE.gather PIE.3D.FFT PIE.3D.FFT.comm. >>> PIE.solve.Elec >>> 1 8. 1 29.7 19.9 6.0 1 .2 >>> 0.7 >>> 2 8.7 30.6 21 .3 8.6 1 .0 >>> 0.5 >>> >>> I am trying to log transform the whole data frame, but I get this error: >>> >>> > d1=log(d11) >>> Error in Math.data.frame(d11) : >>> non-numeric variable(s) in data frame: X, Domain.decomp., >>> Neighbor.search, Launch.PP.GPU.ops., Comm..coord., Force, Wait...Comm..F, >>> PIE.redist..X.F, PIE.gather, PIE.3D.FFT.comm >>> >>> >>> My goal is to make a stacked barplot like this: >>> d2=as.matrix(sapply(d1, as.numeric)) >>> b<-barplot(d2, legend= rownames(data2), beside= >>> TRUE,las=2,cex.axis=0.7,cex.names=0.7,ylim=c(0,80), col=c("#9e9ac8", >>> "#6a51a3")) >>> >>> If I don't log transform my code runs. >>> >>> Please advise, >>> Ana >>> >>> [[alternative HTML version deleted]] >>> >>> ______________________________________________r-h...@r-project.org mailing >>> list -- To UNSUBSCRIBE and more, >>> seehttps://urldefense.com/v3/__https://stat.ethz.ch/mailman/listinfo/r-help__;!!KwNVnqRv!GkOclaf0NPpoVxF8zs_a2pCGlBelsouhJKKR4wG4cG_gEycZ6t-N6nbPvxD1AxnYureFFthr_Nc-zXCU0czR4zGIstg$ >>> PLEASE do read the posting guide >>> https://urldefense.com/v3/__http://www.R-project.org/posting-guide.html__;!!KwNVnqRv!GkOclaf0NPpoVxF8zs_a2pCGlBelsouhJKKR4wG4cG_gEycZ6t-N6nbPvxD1AxnYureFFthr_Nc-zXCU0czRLvLqcYM$ >>> and provide commented, minimal, self-contained, reproducible code. >>> >>> [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org 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.