search for: testplot

Displaying 20 results from an estimated 21 matches for "testplot".

2005 Jun 04
2
locator() via tcltk
...nteractively modify a plot and gather locator() data. I've read Peter's articles in Rnews, the help pages in tcltk, http://bioinf.wehi.edu.au/~wettenhall/RTclTkExamples/, plus a post in R-help sometime ago, but haven't found a solution. The idea goes something like this: require(tcltk) testplot <- function() { getcoords <- function(...) { locator(5) } x <- 1:1000 y <- rnorm(1000) plot(x, y) base <- tktoplevel() loc.pts <- tkbutton(base, text = "Get coordinates", command = getcoords) quit.but <- tkbutton(base, text = "Quit",...
2009 Nov 20
1
How to concatenate expressions
...like in http://tolstoy.newcastle.edu.au/R/help/02a/4790.html). I cannot implement this solution because my expressions and numerical/character vectors are passed to the function and not create inside the function. I would greatly appreciate any help with the following example code. Thank you testplot <- function(a,b,c) { text <- as.expression(paste(a,b,c,sep=' ')) dev.new() plot(-5:5,-5:5,col=0) for (i in 1:3) { text(x=i, y=i, labels=text[i]) } } a <- as.expression(c(bquote(alpha),bquote(beta),bquote(gamma))) b <- as.expression(1:3) c...
2009 Jan 27
0
How do you specify font family in png output; png cross-platform issues
...e paper="special" option is needed so that the eps or pdf output will fit into a document without creating really huge margins around the graph. Correct? x<- rnorm(333) y<- rnorm(333) plot ( x,y, xlab="Input Variable", ylab="Output Variable") xfig(file="testplot.fig", horizontal=F, height=6, width=6, family="Times") plot ( x,y, xlab="Input Variable", ylab="Output Variable") dev.off() postscript(file="testplot-1.eps", horizontal=F, height=6, width=6, family="Times", onefile=F, paper="special&quo...
2013 Feb 20
0
Problems with line types in plots saved as PDF files
Ian No differences with Adobe X with the following windows(6,6) #pdf(file = "TestPlot.pdf", 6, 6) #{ plot(b, l, type = "l", ylim = c(y.min, y.max), lwd = 2, xlab = expression(beta), ylab = "", col = "green", yaxt = "n", xaxt = "n") points(b, p, type = "l", lty = "dotted", lwd = 2, col = "red") poin...
2009 Dec 11
1
ggplot: Problem with legend background
...having problems with the legend background. It doesn't seem to scale when the text size is increased. Here's the mandatory reproducible example: library(ggplot2) repFrame <- data.frame(A= 1:10, B= rnorm(1:10), groupNum = rep(c("First group", "Second group"),each=5)) testPlot <- ggplot(repFrame, aes(x=A, y = B, group = groupNum)) + opts(legend.position=c(0.85,0.3), legend.background = theme_rect(fill="white"), legend.text=theme_text(size=16), legend.title=theme_text(size=20)) testPlot + geom_point(aes(colour= groupNum)) As you can see, the text doesn't...
2009 Jul 02
2
Computer Modern
I am trying to use computer modern fonts in postscript files for a latex document. Ultimately I want to automate this through sweave. I've read the documentation ans have tried the following code to use lattice to produce a graph using computer modern: library(lattice) library(grid) testPlot=( xyplot(seq(1:10) ~ seq(1:10), main="one to ten", xlab="the quick fox", ylab="jumped over the lazy brown dog", xlim=c(0,1), ylim=c(0,1), col="b...
2011 Jul 11
4
Save generic plot to file (before rendering to device)
...ot that took a very long time to produce, I would like to save this plot to a generic file that I can later, on a different machine, render to either PDF, PNG, SVG using the usual R graphics devices, without recalculating the graphical contents. As a toy example, suppose this is my plot function: testplot <- function(){ Sys.sleep(10); #very long and complicated procedure plot(cars); } So the use case is that after running testplot() which took potentially 30 days to calculate, I would like to send a file to my colleagues that they can load in R and send to their png or pdf or svg devices jus...
2011 Jul 11
4
Save generic plot to file (before rendering to device)
...ot that took a very long time to produce, I would like to save this plot to a generic file that I can later, on a different machine, render to either PDF, PNG, SVG using the usual R graphics devices, without recalculating the graphical contents. As a toy example, suppose this is my plot function: testplot <- function(){ Sys.sleep(10); #very long and complicated procedure plot(cars); } So the use case is that after running testplot() which took potentially 30 days to calculate, I would like to send a file to my colleagues that they can load in R and send to their png or pdf or svg devices jus...
2011 Nov 03
0
Back-transforming in lme
Hello I am analysing aboveground biomass data from revegetation testplots which I constructed in a split-plot design using the function lme. For the experiment, the three factors are amelioration (2 levels), fertilizer (2 levels) and treatment (7 levels). Each testplot (block) has a singlereplicate of each treatment (total of 8 testplots). The blocks were constructed of...
2017 Oct 12
1
Recurrence plots in R using different colours
...with six different colours (next to white, which means no recurrence), rather than the plain black and white plot which does not reflect the nature of the recurrence. I hope that my explanation is clear enough. My procedure up until now has been: 1) perform a recurrence quantification analysis: testplot <- rqa(time.series = test$Code, embedding.dim = 1, time.lag = 1, radius = 0.1,lmin =2, vmin =2, distanceToBorder = 2, save.RM = TRUE, do.plot = TRUE) This plot is based on a TRUE FALSE sparse matrix. 2) Accordingly the next step was to transform this TRUE FALSE matrix to one...
2002 Feb 14
2
RFC: "R::Wrapper" perl module
...and line: # just view it, nothing else; % ./script.pl # after viewing, have the option to save as PDF # (prompt for filename): % ./script.pl --pdf # do the same, but specify filenames in advance: % ./script.pl --dump=rawdata.txt % ./script.pl --pdf=testplot.pdf % ./script.pl --ps=testplot.ps # only generate the dump, don't preview at all: % ./script.pl --nopreview --pdf=testplot.pdf # pipe the postscript to something else: % ./script.pl --ps="| enscript -Pbiochem_LJ5P" # the default argument for lpr...
2007 Jun 28
1
Changing graphics height when using grid and lattice
...pct = runif(40, 1, 30) ) # RR data testData2 <- data.frame( strata = rep(c("CHF : Yes", "CHF : No"), each = 10), ae = paste("Adverse Event", 1:10), rr = runif(20, 0.5, 5) ) testData2$lower = testData2$rr / 2 testData2$upper = testData2$rr * 2 # Combined plot testPlots <- function(relativeWidth) { plot1<- dotplot( ae ~ pct | strata, groups = trt, data = testData, layout = c(1, 2), xlab = "Percent", auto.key = list(space = "top", columns = 2) ) plot2 <- Dotplot( ae ~ Cbind(rr, log10(lower), log10(upper)) | strata, data...
2008 Jan 01
2
Alignment and Labeling of a color key in a xyplot?
...key' argument in 'draw.colorkey' some arguments, but I could not manage to put a label on the color key. Thanks very much. Marius library(lattice) library(grid) x=c(1,2,3) colorseq=c(0.2,0.5,0.8) mycolors=gray(colorseq) #trellis.device(postscript,horizontal=F,onefile=F,file="~/testplot.ps") xyplot(x~x,col=mycolors,aspect=1) draw.colorkey(key=list(at=seq(1,3,length=4),col=mycolors,text=list(c ("test"))),draw=TRUE,vp=viewport(x=1,y=0.6,height=0.8)) #dev.off()
2013 Feb 12
8
Help with functions as arguments
Hi, I am trying to write a function which defines some arguments, then uses those arguments as arguments of other function calls. It's a bit tricky to explain, so a simple example will have to suffice. I imagine this has a simple solution, but perusing through environments and other help lists has not helped. Suppose I have two functions: f1 = function(a) {     b = a + 1     b } f2 =
2006 Feb 10
1
Question on big JPG plots in function warpping format
...quot;test1.jpg", sep="") jpeg(file=filename) # plotHeatTrellis(dataPath, plotVariable = "Raw", plotPlatesAlong) dev.off() } ######### enf of the program I've tested the simple plot function, like ########## works fine both with in script and function wrapping format testplot <- function(plotDirPath) { filename1 <- paste(plotDirPath, "test1.jpg",sep="") jpeg(file=filename1) plot(1:10, rnorm(10, 0), type="b") dev.off() } ########### Any one have any clues, why this happen and how could I fix my code and my mine working also in the fun...
2010 Aug 10
1
Sweave with dev.new()
...test} \begin{document} \section{Plotting} <<label=testfig,include=FALSE,echo=TRUE>>= dev.new(width=7,height=6,record=TRUE) plot(1:10,col="red") @ \begin{figure}[ht] \begin{center} <<label=fig,fig=TRUE,echo=FALSE>>= <<testfig>> @ \end{center} \caption{Testplot} \label{fig:test} \end{figure} \end{document} When I run Sweave on this file I get empty pdf and eps files named "Sweavetest-fig.pdf" and "Sweavetest-fig.eps", and the corresponding latex file is unable to create a PDF-file. Does anyone know what the problem is, and how I mi...
2016 Apr 25
0
ylim in barplot()
...ut using package devEMF and it will crop the bars with xpd=FALSE. When I used devEMF on a Windows machine, the bars were not cropped with barplot() as you indicated, but when I switched to plotrix::barp() they were cropped. The arguments are a bit different, but I did not need xpd=FALSE: emf("TestPlot.emf") barp(t(mydata), col=c("orange", "green", "yellow", "purple"), ylim=c(50,70), legend.lab=colnames(mydata), legend.pos="topright") dev.off() ------------------------------------- David L Carlson Department of Anthropology Texas A&M Un...
2016 Apr 26
1
ylim in barplot()
...package devEMF and it will crop the bars with xpd=FALSE. When I used devEMF on a Windows machine, the bars were not cropped with barplot() as you indicated, but when I switched to plotrix::barp() they were cropped. The arguments are a bit different, but I did not need xpd=FALSE: > > emf("TestPlot.emf") > barp(t(mydata), col=c("orange", "green", "yellow", "purple"), > ylim=c(50,70), legend.lab=colnames(mydata), legend.pos="topright") > dev.off() > > ------------------------------------- > David L Carlson > Department...
2016 Apr 25
2
ylim in barplot()
Dear useRs, I'm having troubles with using ylim in barplot(): even though I reduce the y-scale using ylim, the bars still extend down to 0into the x-labels. The sample data is below, and here is the code. #This works fine but I would like to plot only from 50 to 70: barplot(t(mydata), beside=TRUE, col=c("orange", "green", "yellow", "purple"),
2001 Nov 21
0
save results from cron job
...("chris_db","","") ausgaben <- sqlFetch(channel,"ausgaben") plot(ausgaben$kosten,type="l") cor(ausgaben$kosten,ausgaben$kategorie) # str(hist(ausgaben$KATEGORIE, col="gray", labels = TRUE)) savePlot(filename= "c:/test/apache/htdocs/testplot" , type=("jpg"),device=dev.cur()) odbcClose(channel)} while(1) { query_ausgaben() Sys.sleep(15)} -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "h...