similar to: standardize ggplot and lattice themes

Displaying 20 results from an estimated 1100 matches similar to: "standardize ggplot and lattice themes"

2008 Aug 25
1
lattice : using both strip and strip.left
Dear all, I'm routinely using lattice and ggplot2, I wish to create a lattice theme that looks not too dissimilar to ggplot's defaults so I can include both graphs in a document with a consistent look. To illustrate my questions, consider the following example: > library(ggplot2) > library(lattice) > > # example data > x <- seq(0, 10, len = 100) > y1 <-
2012 Feb 03
1
incomplete final line found on <name of my sourced function file>
Dear R-ers, I hope there is a really simple solution to my problem. I've written a function that I saved in an .r file. I source this file in my code. For a while it worked fine. But then when I run the line: source("F mylineplot.r") I started getting a warning: In readLines(file) : incomplete final line found on 'F mylineplot.r' I have no idea why - I tried to check and
2010 Aug 13
1
Lattice: Superimposing histograms with different colors and transparency effects
Dear users, I would like to plot several histograms superimposed on the same panel with different colors, with superimposed polygons appearing with transparency effects. I also want estimated densities to appear on the same plot. For several reasons, including that I like it, I want to use the lattice package. I have several questions regarding the use of the 'histogram' function with a
2009 Nov 26
1
Adding text in the panels for Trellis plot ...
i was trying to do a for loop for plotting the histograms , but it doesnt work properly > library(lattice) > columns <- 8:153 > plots <- vector("list", length(columns)) > j <- 0 > for (i in columns) + { + plots[[ j <- j+1 ]] <- histogram( ~ data[,i] | data[,2],ylab = "Frequency", + xlab = "Score", xlim = c(1,5), ylim =
2008 Jan 01
2
Alignment and Labeling of a color key in a xyplot?
Happy New Year to all R users! I have two short questions concerning a xyplot with a color key: 1) How do I properly place (align) the color key beside the xyplot? As you can see from the code listed below, the placement of the color key is not correct. I would like the upper and lower end point of the color key to be perfectly aligned with the upper and lower line of the xyplot. Adjusting
2006 Jul 10
2
Setting the colors of lines in a trellis plot...
With some help from those with expertise on this list, I managed to produce a plot using trellis that looked like I wanted it to look. Now, I need to take the same plot and make the lines on it color, but I want to specify the color for the lines myself. I've managed to make the key use the colors I want. I've managed to make the symbols of the actual plot use the colors I want. But I
2016 Apr 16
0
Mean of hexadecimal numbers
Since these are color strings, you can use functions in the grDevices package (other others) to manipulate them. E.g., you can convert them to various color spaces and perhaps use the mean in one of those spaces as your 'average color'. > myColors <- c(One="#FF7C00",Two="#00BF40",Three="#FFFF00") > col2rgb(myColors) One Two Three red
2012 Aug 22
1
Plot label axis with expression
Hi all, I need help with axis in plot. I want to edit y axis label of my plot. My data is like: x <- c(100,50,10,1,0.1,0.05,0.001) plot(log(x)) axTicks(2) # Label of y axis [1] -6 -4 -2 0 2 4 I'd like that y axis label was like: e^-6, e^-4, etc. (with text "e" superscript -6, -4, etc.) I try to use expression(), but don't work. plot(log(x), yaxt="n")
2004 Feb 19
1
Possible error in ?axTicks
Hi all, Before posting to r-bugs, I thought that I would just verify this one first. It looks like the help for axTicks() needs to be corrected. It presently says: 'axTicks()' can be regarded as an R implementation of the C function 'CreateAtVector()' in '..../src/main/graphics.c' which is called by 'axis(side,*)' when no argument 'at' is specified.
2008 Oct 07
2
panel.groups: use group.number to define colors
Dear list, I've been trying this for a few hours and I just don't understand how lattice works with groups and subscripts. Consider the following example, > xx <- seq(1, 10, length=100) > x <- rep(xx, 4) > y <- c(cos(xx), sin(xx), xx, xx^2/10) > fact <- factor(rep(c("cos", "sin", "id", "square"), each=100)) > fact2
2011 Feb 04
1
axTicks.Rd documentation bug
?axTicks says: usr: numeric vector of length four, defaulting to ?par("usr")? giving horizontal (?x?) and vertical (?y?) user coordinate limits. but this is not how the function is implemented -- in fact 'usr' should be a vector of length two corresponding to the appropriate elements of par("usr") [1:2 if side is 1 or 3, 3:4 if side is 2 or
2003 Oct 29
1
Wishlist: user-specified color names for palette() (PR#4836)
Full_Name: Hsiu-Khuern Tang Version: 1.8.0 OS: GNU/Linux (Debian unstable) Submission from: (NULL) (156.153.255.243) Hi, I use palette(rgb(red=..., green=..., blue=..., names=mycolors)) to define my own color palette. After doing this, the names `mycolors' are not stored in palette() anymore, so that palette() returns a mix of built-in color names and RGB values. Eg: > palette()
2010 Nov 20
2
plotting a timeline
I was trying to recreate this kind of timeline plot: http://www.vertex42.com/ExcelArticles/create-a-timeline.html As you can see in their excel example, the events are nicely placed out on both sides of the timeline axis. AFAIK there is no function to do this nicely in R-project. Furthermore, graphics and lattice packages are unable to draw the x-axis in the middle of the plot. (datapoints
2016 Apr 16
1
Mean of hexadecimal numbers
Hm..., Should these two versions produce the same solution? Unfortunately and shame to confess, I don't know much about the colors in R: myColors <- c("#FF7C00","#00BF40","#FFFF00") Colors=rgb2hsv(col2rgb(myColors)) apply(Colors,1,mean) h s v 0.2122974 1.0000000 0.9163399 * * * * * # Average the 1st two by taking the middle colour
2004 Mar 25
1
How to add a top X-axis with a different logarithmic scale?
Hi, I am trying to put on one plot two different logarithmic scales, using the bottom and top X-axes. Below there is an example of what I am trying to achieve, using axTicks() -- and fails. I already spent few hours on that, and cannot figure out from ?par and ?axTicks what I am doing wrong. Example follows: ############################################################ #### Data x <-
2017 Nov 12
2
create waveform sawtooth
My tuneR sawtooth wave function generator is broken. When I use the sine function, I get exactly what I expect: a sine wave whose frequency is defined by the freq parameter. In particular, higher frequencies have shorter wavelengths (more cycles per second means shorter waves). When I create a sawtooth wave, the opposite seems to occur: higher frequencies result in longer waves. But that?s not
2006 Jun 14
1
Estimate region of highest probabilty density
Estimate region of highest probabilty density Dear R-community I have data consisting of x and y. To each pair (x,y) a z value (weight) is assigned. With kde2d I can estimate the densities on a regular grid and based on this make a contour plot (not considering the z-values). According to an earlier post in the list I adjusted the kde2d to kde2d.weighted (see code below) to estimate the
2017 Nov 12
0
create waveform sawtooth
Ccing the maintainer if the tuneR package. Looks to me like sawtooth (and square) don't behave as expected when using xunit="samples". Workaround is to use xunit="time" instead: sawtooth(110,duration=1/100,samp.rate=sample_rate,xunit="time") I looked at the code but found it to be opaque. -- Sent from my phone. Please excuse my brevity. On November 12, 2017
2005 Aug 18
2
axTicks and window resizing
Dear listers, I have written a function to facilitate the drawing of altitude profiles with x (distance), y (altitude) and a z parameter (altitude magnification). profplot<-function(x,y,z=10,...){ op <- par()$mai par(mai=c(0.95625,0.76875,0.76875,0.95625)) plot(x,y*z, type="l",asp=1,las=1,xlab="",ylab="",yaxt="n",...)
2004 Dec 22
0
weighted kernel density estimation
Dear wizaRds, I use the MASS::kde2d function to estimate density of the two first principal components. I do that to have a graphic visualisation of a "group structure" in my dataset. So far, no problem. But i would like to estimate that density using weights according to the COS?? values that tells me if my observation is well represented on the factorial plan 1-2. I would like to