Displaying 20 results from an estimated 50000 matches similar to: "Move the x label to the top of an lattice plot"
2011 Sep 15
1
Move the x-axis labels to the top of the dotplot
Dear R helpers
I would like to move the x-axis labels, which plot automatically at the base
of a dot plot to the top of the plot. Is there a way to do this?
Code snippet below
with(Cal_dat,
dotplot(reorder(paste(Mine,Company), Resc_Gt) ~ Resc_Gt,
fill_var = Commodity,
pch_var = factor(Year),
xlab_var = factor(Company),
pch = c(21, 22, 23),
2008 Jan 23
1
adjusting y axis labels in lattice plots?
Are there parameters that would allow adjusting y axis labels in lattice
plots? E.g in the following simple example
require(lattice)
xyplot(rnorm(10) ~ 1:10, scales=list(alternating=2))
it would be nice to have the y axis labels adjusted to the right or at the
decimal point instead of left adjustment.
Thomas Zumbrunn
--
Thomas Zumbrunn
Institute of Zoology, University of Basel
Vesalgasse
2011 Apr 05
2
Arrangement of Lattice Histograms - Top to bottom and then left to right?
Hi List,
Using Lattice, I have created a plot of histograms showing Fork Length by
Year. The plot shows the histograms in 3 columns and 5 rows. Using the
as.table=T function I can get the years to start on top. However, what I
would like to do is have the first year start in the top left (column 1, row
1; as it is now) and add the subsequent histograms to the plot going down
the column and then
2011 Jul 21
6
Lattice: place ticks only on y-axis
I am using lattice for a bar plot, having a little trouble removing ticks,
tick labels from x-axis, but keeping them on the y-axis. I looked around
quite a bit (http://tolstoy.newcastle.edu.au/R/e7/help/09/06/1733.html, help
pages, etc), tried variations of "scales = list(alternating = c(0,0)",
"scales = list(alternating = c(0,0), tck = c(0,0))" and others, couldn't
quite
2011 Mar 10
1
Lattice: Feature Request
Hi,
I'm currently designing some global themes for use with lattice, and have
hit a snag. There doesn't appear to be (in xyplot at least) a way of setting
a lattice option for the 'scales' parameter at a global level - changes have
to be made in each function call. For example, consider the following code:
library(lattice)
library(latticeExtra)
# Create some data
temp <-
2011 Mar 10
3
lattice xscale.components: different ticks on top/bottom axis
Good afternoon,
I am trying to create a plot where the bottom and top axes have the same
scale but different tick marks. I tried user-defined xscale.component
function but it does not produce desired results. Can anybody suggest
where my use of xscale.component function is incorrect?
For example, the code below tries to create a plot where horizontal axes
limits are c(0,10), top axis has ticks
2011 Aug 19
2
Auto key legend does not match plot
Dear R-help members. I am an 'R-learner' (about 6 hours so far) using the
lattice library to create a ranked dotplot and am colour coding the dots by
a variable called "Commodity". However when i use autokey to make a legend
the size (cex) and symbol (pch) do not match what is on the dotplot.
Code is below and image attached
library("lattice")
Cal_dat <-
2009 Apr 15
1
Lattice xyplot with text under x-axis
Hi All,
I have a data set which I need to plot and show the values of one of the
variables as a second x-axis.
library(lattice)
year<-c(2001,2002,2003,2004,2005,2006)
fac<-c("arts","arts","arts","sci","sci","sci")
staff<-c(95,98,99,32,31,36)
part<-c(32,31,33,15,16,14)
df1<-data.frame(year,fac,staff,part)
2005 Jun 01
2
problem with chron scales in lattice
I can't get the scales parameter in xyplot of lattice to work as I
expected. I'm using R-2.1.0 and lattice 0.11-8. There should be year
labels from 1992 to 2004 for the x axis in the plot below, but instead
only a few of them appear, and in the wrong spots, as if the coordinate
system has changed after finishing with the panel function.
library(chron)
library(lattice)
# vertical grid
2011 Jul 22
2
Lattice: distance of Y-axis label from plot
Basic question: I looked around quite a bit, still having a little trouble
manipulating the distance between the Y-axis label and the plot. In this
case, I would like to move the Y axis title closer to the plot.
# Data
tC <- textConnection("
Time Type1 Type2 Type3
1.3 .50 .10 .40
4.5 .45 .20 .35
5.2 .40 .30 .30
")
data1 <- read.table(header=TRUE, tC)
data2 <-
2007 Dec 10
1
lattice: placing y-axis labels on right-hand side of panel when relation="sliced"
Hello,
I'm using lattice to create a multi-panel figure. I would like
to draw each panel's y-axis ticks and labels on the right-hand
side of the panel. Ordinarily, I would do this by specifying
scales=list(y=list(draw=T, alternating=2)). But in this case, I am
using relation="sliced" to determine the y-axis limits. So
"alternating" is ignored. Is there any
2010 May 24
1
lattice 'scales' option help
Hi All,
I'm trying to draw boxplots. I'm having a hard time to get "ticks labels" on
multiple panels using 'alternating' option.
# R Code:
# May not be the best example, please just look into 'scales' option
library(lattice)
data(OrchardSprays)
dta <- subset(OrchardSprays, OrchardSprays$rowpos %in% c(1,2,3))
# Original
# This works fine, as you can see
2011 Sep 15
1
Colour code y-axis labels on a dot plot
Dear R helpers
I would like to be able to colour code the y-axis labels on a complex dot
plot by a variable known as company (of which there are only two). The code
is below and data attached.
Thanks
MarkM
library("lattice")
library(latticeExtra) # for mergedTrellisLegendGrob()
# set size of the window
windows(height=10, width=7,rescale=c("fixed"))
##read the data to a
2011 Mar 26
1
bwplot [lattice]: how to get different y-axis scales for each row?
Dear expeRts,
How can I get ...
(1) different y-axis scales for each row
(2) while having the same y-axis scales for different columns?
I coulnd't manage to do this with relation="free" [which gives (1) but not (2)].
I also tried relation="sliced", but it did not give the same y-axis scales
within each row (see the fourth row). Further, it "separates" the
2008 Feb 05
1
Inconsistent lattice scales$x$at,label behaviour for POSIXct
I have encountered the following behaviour in lattice in 2.6.1 (and
2.4.0) which differs depending upon the type you use. I believe the
numeric behaviour to be correct, and the POSIXct behaviour to be in
error.
When the x data and x axis in a lattice graph are POSIXct, and when
using scales$x$at and scales$x$labels to add custom labels:
If the first visible at value is not the first
2008 May 06
1
Spacing between lattice panels
I'm trying to set up a lattice plot with two y-axes for each panel. (Yes,
I know that multiple y-axes are generally a bad idea; the graph is for
someone else and they want it that way.) I've used a custom
yscale.component in xyplot to achieve this:
myyscale.component <- function(...)
{
ans <- yscale.components.default(...)
ans$right <- ans$left
foo <-
2013 Jun 10
1
Using Lattice, LatticeExtra - Hide right and top axes in multipanel plots
Dear Rxperts,
How do I hide the top and right axes in multiple panel plots? A couple of
examples are provided below.. Would highly appreciate appreciate your
assistance..
#Example 1
library(latticeExtra)
xyplot((1:200)/20 ~ (1:200)/20, type = c("p", "g"),
scales = list(x = list(log = 2,alternating=0), y = list(log =
10,alternating=0)),
xscale.components =
2008 Jul 28
2
axis.break on Date-x-axis in lattice xyplot
Dear list,
i am using the following code to produceĀ a lattice xyplot, but the
axis.break-function is seemingly not executed.
Date<-seq(as.Date("2006-08-29"), as.Date("2007-08-28"), by="2 weeks")
Period<-
var1<-rnorm(27, 90000000, 30000000)
var2<-rnorm(27, 500000000,250000000)
var3<-rnorm(27, 1000000,500000)
var4<-rnorm(27, 600000,300000)
2011 Jan 20
2
adding text to y-axis per row of panels (lattice)
Dear all,
Being a newbie to R, I've trawled through many old posts on this list
looking for a solution to my problem, but unfortunately couldn't quite
figure it out myself. I'd be very grateful if someone here on this
list could perhaps help me out.
I have a lattice plot with several panels and would like to add some
text next to the y-axis on the right hand side of each row of
2012 Nov 22
1
[lattice] Increase distance between tick labels and ticks in wireframe plot ("pad")
Hello,
I try to increase the distance between tick labels and ticks in a lattice wireframe plot. Here's a minimal example:
## Minimal example
x <- y <- z <- c(1,2,3)
df <- data.frame(x, y, z)
wireframe(z ~ x*y, df, scales = list(arrows = FALSE, col = "black", font = 1, tck=0.6))
I tried the axis.components option