search for: fig1

Displaying 20 results from an estimated 41 matches for "fig1".

Did you mean: fig
2024 Feb 05
2
ggarrange & legend
Dear John Kane Dear R community Here my working example 1. Example that is working with legend=?top?. However, as mentioned, the legend is in the middle of the top axis. mylist<-list(p1, p2) dev.new(width=28, height=18) fig1<- ggarrange(plotlist=mylist, common.legend = TRUE, legend="top", labels = c("(A)", "(B)"), font.label = list(size = 18, color = "black"), ncol=2) fig1 2. My question is how I can position the legend on the topright of the top axis. However, ?topright?...
2024 Feb 05
1
ggarrange & legend
...uot;, color = "dose", palette = "jco")# Density plotdens <- ggdensity <https://rpkgs.datanovia.com/ggpubr/reference/ggdensity.html>(df, x = "len", fill = "dose", palette = "jco") mylist<-list(bxp, dens) dev.new(width=28, height=18) fig1<- ggarrange(plotlist=mylist, common.legend = TRUE, legend="top", labels = c("(A)", "(B)"), font.label = list(size = 18, color = "black"), ncol=2) fig1 #===================================================================================== On Mon, 5 Feb 2...
2013 Jan 28
1
Adding 95% contours around scatterplot points with ggplot2
...,0.6,length.out=30)) y<-c(0.55,x[1:29]+0.2*rnorm(29,0.4,0.3),x[31:60]*rnorm(30,0.3,0.1),x[61:90]*rnorm(30,0.4,0.25)) data<-data.frame(level=c(rep(1, 30),rep(2,30), rep(3,30)), x=x,y=y) find_hull <- function(data) data[chull(data$x, data$y), ] hulls <- ddply(data, .(level), find_hull) fig1 <- ggplot(data=data, aes(x, y, colour=(factor(level)), fill=level))+geom_point() fig1 <- fig1 + geom_polygon(data=hulls, alpha=.2) fig1 [[alternative HTML version deleted]]
2012 Aug 21
2
Sweave: R chunk inside caption?
...ps I'll have to write the "\caption{}" text with R? thanks! Sweave document: \documentclass{article} \title {test} \author {me} \usepackage{Sweave} \begin {document} \maketitle \DeclareGraphicsExtensions{.pdf,.png} \begin {figure} <<label=fig1, echo=FALSE, fig=TRUE, pdf=false, png=true>>= plot(runif(100), runif(100)) @ \caption { This is the caption with some r-code <<>>= 2*2 @ } \label {fig:1} \end {figure} \end{document} TeX document: \documentclass{article}...
2017 Aug 25
2
about multi-optimal points
...ir correlations, but I want v1 and v3 to be as close as 1, v2 to be as close as 0. Thanks very much. DF ID v1 v2 v3 1 0.8 0.1 0.7 2 0.85 0.3 0.6 3 0.9 0.21 0.7 4 0.95 0.22 0.8 5 0.9 0.3 0.7 6 0.8 0.4 0.76 7 0.9 0.3 0.77 ... fig1 = ggplot(data=DF, aes(x=v1,y=v2))+ geom_point()+ theme_bw()+ xlab('Variable 1')+ ylab('Variable 2') print(fig1) fig2 = ggplot(data=DF, aes(x=v1,y=v3)+ geom_point()+ theme_bw()+ xlab('Variable 1')+ ylab('Variable 3') print(fig2) [[alternative HTML version deleted]]
2017 Jun 18
2
About error bars on barplots
...ear A B C Amin Amax Bmin Bmax Cmin Cmax 2009 40 45 15 30 61 23 56 14 17 2010 36 41 23 26 54 22 51 22 24 I use the code below: DF.refm = melt(subset(DF[,c(1:4)]),id.vars='year',variable_name='Legend') fig1 = ggplot(data=DF.refm, aes(x=year,y=value,fill=Legend))+ geom_bar(stat='identity',size=.5)+ theme_bw()+ xlab('Year')+ ylab('Percent (%)') print(fig1) But I don't know how to change it a little bit. For example, how to add the error bars on the plot, as is shown in the...
2007 Oct 24
4
X11 graphics windows under CMD BATCH
Hi there, I am trying to plot some output from a FORTRAN (ifort) program using R (2.5.1) under batch mode. In the FORTRAN code, I call R in batch mode to execute a script called fig1.R using something like PROGRAM test USE IFPORT IMPLICIT NONE DO !Some function which makes an output file called ~/fortran_output.txt CALL myfunc() !System call to R plotting routine CALL SYSTEM ("open -a x11") CALL SYSTEM ("R CMD BATCH ~/fig1.R") END DO END PRO...
2012 Dec 02
1
Problem with figures
I am having problem making ggplot2, tikzDevice, and knitr working together. I used a very simple example: ---------------------------example.Rnw----------------------------- \documentclass[preview]{standalone} \begin{document} \begin{figure} <<fig1,eval=TRUE,echo=FALSE,dev='tikz'>>= library(ggplot2) qplot(displ, hwy, data = mpg, colour = factor(cyl)) @ \end{figure} \end{document} --------------------------------------------------------------------------------- I got "... ! ==> Fatal error occurred, no output PDF file p...
2024 Feb 05
1
ggarrange & legend
Could you supply us with a MWE (minimal working example)of what you have so far? Thanks. On Mon, 5 Feb 2024 at 05:00, SIBYLLE ST?CKLI via R-help < r-help at r-project.org> wrote: > Dear R community > > It is possible to adjust the legend in combined ggplots using ggarrange > with > be positions top, bottom, left and right. > My question: Is there a function to change the
2010 Nov 15
1
Sweave: Conditional code chunks?
I have a code junk that produces a figure. In my special case, however, data does not always exist. In cases where data exists, the code chunk is of course trival (case #1), however, what do I do for case # 2 where the data does not exist? I can obviously prevent the code from being executed by checking the existence of the object x, but on the Sweave level I have a static figure chunk. Here an
2004 Dec 06
2
Blank eps output files
Dear all, The following commands results in a blank graph file, postscript(file = "C:/Temp/Fig1.eps", height=4.0, width=4.0, horizontal = FALSE, onefile = FALSE, paper = "special") x11(height=3,width=3) par(mar=.1+c(4.5,4.5,0,0)) x <- c(10,20,30) y <- c(5, 7, 9) plot (x,y) dev.off() The codes function normally without any error in the command window. However, the resu...
2017 Jun 18
0
[FORGED] About error bars on barplots
...Cmin Cmax > 2009 40 45 15 30 61 23 56 14 17 > 2010 36 41 23 26 54 22 51 22 24 > > I use the code below: > > DF.refm = melt(subset(DF[,c(1:4)]),id.vars='year',variable_name='Legend') > > fig1 = ggplot(data=DF.refm, aes(x=year,y=value,fill=Legend))+ > geom_bar(stat='identity',size=.5)+ theme_bw()+ xlab('Year')+ > ylab('Percent (%)') > print(fig1) > > But I don't know how to change it a little bit. For example, how to add the > error bars...
2017 Aug 26
0
about multi-optimal points
...gt; close as 0. Thanks very much. > > DF > > ID v1 v2 v3 > 1 0.8 0.1 0.7 > 2 0.85 0.3 0.6 > 3 0.9 0.21 0.7 > 4 0.95 0.22 0.8 > 5 0.9 0.3 0.7 > 6 0.8 0.4 0.76 > 7 0.9 0.3 0.77 > ... > > fig1 = ggplot(data=DF, aes(x=v1,y=v2))+ geom_point()+ theme_bw()+ > xlab('Variable 1')+ ylab('Variable 2') > print(fig1) > > fig2 = ggplot(data=DF, aes(x=v1,y=v3)+ geom_point()+ theme_bw()+ > xlab('Variable 1')+ ylab('Variable 3') > print(fig2) > >...
2011 May 06
1
Sweave: no eps fig
Hi everyone, I'm using R, Latex and Sweave for some years now, but today it confuses me alot: Running Sweave produces only figures in .pdf format, no .eps figures. The header looks like this: <<echo=TRUE, fig=TRUE, label=Fig1>>= There was no error message. Does anybody have an idea? Any changes in the Sweave-package? Or a missing driver or something like that? I recently switched to another OS (Fedora RedHat) - might that be the reason? Grateful for any suggestions, Lena --
2012 Oct 30
1
print and execute functions in a package namespace
Let's say I have a package that consists of a set of functions, fig1(), fig2(), fig3() ..., each of which produces a plot, and perhaps some printed output, e.g., fig1 <- function() plot(1:10) fig2 <- function() plot(10:1) fig3 <- function() {y<-sample(1:10,10); plot(y); y} I'd like to produce a document (PDF or HTML) containing the listing of ea...
2000 Feb 14
2
par(fig) problem
hello R-users, I'd like to plot four graphics on the same page but with different sizes. I've tried to use : par(fig=c(0,0.5,0,0.6)) plot(fig1) par(fig=c(0.5,1,0,0.6)) plot(fig2) etc... but when a figure is plotted, it erase the previous. I've tried to pass 'new=T' to plot function but it's not possible. What can I do ? is it a bug ? I've already reported this a 2 or 3 month ago but I can't find out the answers I...
2010 Sep 15
3
Creating publication-quality plots for use in Microsoft Word
Hi everyone, I am trying to make some publication-quality plots for use in Microsoft Word, but I am having trouble creating high-quality plots that are supported by Microsoft Word. If I use the R plot function to create the figure, the lines are jagged, and the picture is not of high quality (same with JPEG(), TIFF(), and PNG() functions). I have tried using the Cairo package, but it distorts
2023 Nov 24
1
ggplot adjust two y-axis
Dear R-users Is it possible to adjust two y-axis in a ggplot differently? - First y axis (0-60) - Second y axis (0-2500) ### Figure 1 ggplot(Fig1,aes(BFF,Wert,fill=Studien_Flaeche))+ geom_bar(stat="identity",position='dodge')+ scale_y_continuous(name="First Axis", sec.axis=sec_axis(trans=~.*50, name="Second Axis"))+ scale_fill_brewer(palette="Set1") Thanks a lot Sibylle -------------- n...
2023 Nov 24
1
ggplot adjust two y-axis
...-project.org> De la part de sibylle.stoeckli at gmx.ch Envoy??: 24 novembre 2023 05:52 ??: r-help at r-project.org Objet?: [R] ggplot adjust two y-axis Dear R-users Is it possible to adjust two y-axis in a ggplot differently? - First y axis (0-60) - Second y axis (0-2500) ### Figure 1 ggplot(Fig1,aes(BFF,Wert,fill=Studien_Flaeche))+ geom_bar(stat="identity",position='dodge')+ scale_y_continuous(name="First Axis", sec.axis=sec_axis(trans=~.*50, name="Second Axis"))+ scale_fill_brewer(palette="Set1") Thanks a lot Sibylle
2000 Feb 14
0
summary : par(fig)
...ion doesn't match my needs. E. Paradis and P. Dalgaard made me discover a new (for me!) function : layout() which may do the job (I'm exploring the possibilities). But I finally chose the P. Dalgaard' s solution of setting par(new=T) between each plot say: par(fig=c(0,0.5,0,0.6)) plot(fig1) par(fig=c(0.5,1,0,0.6),new=T) plot(fig2) etc. thanks very much, Mathieu ---------------------------------------------------------------------- Mathieu Ros - 13 rue b?vi?re - 38000 GRENOBLE - 04 76 491 370 http://mathieu.ros.free.fr/ DESS ing?nierie math?matique (biostatistiques) Universite J...