Displaying 20 results from an estimated 3000 matches similar to: "ggplot2: Changing colour scheme for bar plot filling?"
2010 Dec 06
2
ggplot2: Controlling line width of panel borders
Dear R-users,
i encountered some problems when trying to adjust the line width of the
axes and stripes in a plot created with ggplot2.
I use the "barley" dataset of the lattice package to illustrate my problem:
library(ggplot2)
library(lattice)
barley[["SD"]] <- 5
limits <- aes(ymax=barley$yield + barley$SD,ymin=barley$yield - barley$SD)
p1 <-
2010 Sep 10
3
ggplot bar geom: control the filling in the colour legend
Hi all,
Is it possible to change the filling of the squares used to represent
the colour legend in a bar plot with ggplot?
in this example, fillings are raven black, I'd like them white.
ggplot(diamonds, aes(clarity, colour = cut)) + geom_bar()
Regards
--
-------------
Benoit Boulinguiez
Ph.D student
Ecole de Chimie de Rennes (ENSCR) Bureau 1.20
Equipe CIP UMR CNRS 6226 "Sciences
2012 Jul 04
3
Printing from R Console in colour
Hi,I
want to be able to print in colour from the R console i.e. commands (in navy) with
results (in red) as on the console.
From
the console if I click on File -> Print, the commands with results print
on my printer but only in monochrome, not in colour. Similarly, if I Edit ->
Select All, Edit -> Copy --- and paste into Word, the commands and results
are only in monochrome, not in
2012 Mar 15
2
Ggplot barchart drops factor levels: how to show them with zero counts?
Hello,
When plotting a barchart with ggplot it drops the levels of the factor for
which no counts are available.
For example:
library(ggplot)
mtcars$cyl<-factor(mtcars$cyl)
ggplot(mtcars[!mtcars$cyl==4,], aes(cyl))+geom_bar()
levels(mtcars[!mtcars$cyl==4,])
This shows my problem. Because no counts are available for factorlevel '4',
the label 4 dissapears from the plot. However, I
2007 Jun 29
1
Print grid/ggplot to a metafile
Dear UseRs called Hadley, or Paul,
I am trying to print an edited ggplot2/grid graphics to a metafile. With the
commented line below it works, but when I edit the plot by uncommenting the
line, it fails, because it's illegal to have 2 graphics in a metafile. It
works with pdf, but even then I get two plots, which is a nuisance.
I found a workaround by using windows(); savePlot, but it only
2013 Apr 17
2
remove higher order interaction terms
Dear all,
Consider the model below:
> x <- lm(mpg ~ cyl * disp * hp * drat, mtcars)
> summary(x)
Call:
lm(formula = mpg ~ cyl * disp * hp * drat, data = mtcars)
Residuals:
Min 1Q Median 3Q Max
-3.5725 -0.6603 0.0108 1.1017 2.6956
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1.070e+03 3.856e+02 2.776 0.01350 *
cyl
2011 Dec 04
1
Polishing my geom_bar for publication
Dear list,
I am new with ggplot2 and I have spend quiet some time putting together the following code to create the attached plot. However there's still a few things that I'm having trouble with!
I would be grateful if someone can tell me how to fix (1) the colour of my bars into grey scales (2) removing the y-axis (species name) on the right figure to avoid duplication, and (3) fix the
2010 May 29
4
ZFS and IBM SDD Vpaths
I have 6 zfs pools and after rebooting init 6 the vpath device path names have changed for some unknown reason. But I can''t detach, remove and reattach to the new device names....ANY HELP! please
pjde43m01 - - - - FAULTED -
pjde43m02 - - - - FAULTED -
pjde43m03 - - - - FAULTED -
poas43m01 - - - -
2011 Aug 09
7
Disk IDs and DD
Hiya,
Is there any reason (and anything to worry about) if disk target IDs don''t start at 0 (zero). For some reason mine are like this (3 controllers - 1 onboard and 2 PCIe);
AVAILABLE DISK SELECTIONS:
0. c8t0d0 <ATA -ST9160314AS -SDM1 cyl 19454 alt 2 hd 255 sec 63>
/pci at 0,0/pci10de,cb84 at 5/disk at 0,0
1. c8t1d0 <ATA -ST9160314AS -SDM1
2012 Mar 28
2
problem: bsdlabel
hail,
I partitioned the disk this way:
fdisk da0
******* Working on device /dev/da0 *******
parameters extracted from in-core disklabel are:
cylinders=12161 heads=255 sectors/track=63 (16065 blks/cyl)
Figures below won't work with BIOS for partitions not in cyl 1
parameters to be used for BIOS calculations are:
cylinders=12161 heads=255 sectors/track=63 (16065 blks/cyl)
Media sector size
2010 Aug 04
3
retrieve name of an object?
Dear all
Is there an easier way to retrieve the name of an object? For example,
> tmp <- 1:10
> as.character(quote(tmp))
[1] "tmp"
> as.character(quote(mtcars$cyl))
[1] "$" "mtcars" "cyl"
> as.character(quote(mtcars$cyl))[3]
[1] "cyl"
The last call more than anything seems a hack. Is there a better way?
Thank you
Liviu
2007 Oct 01
4
how to plot a graph with different pch
I am trying to plot a graph but the points on the graph should be
different symbols and colors. It should represent what is in the legend.
I tried using the points command but this does not work. Is there
another command in R that would allow me to use different symbols and
colors for the points?
Thank you kindly.
data(mtcars)
plot(mtcars$wt,mtcars$mpg,xlab= "Weight(lbs/1000)",
2008 Jul 11
3
Linux equivalent of 'format' in solaris
It shows the physical disks on the server
bash-2.05b# format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
0. c0t2d0 <SUN18G cyl 7506 alt 2 hd 19 sec 248>
/sbus at 3,0/SUNW,fas at 3,8800000/sd at 2,0
1. c0t3d0 <SUN18G cyl 7506 alt 2 hd 19 sec 248>
/sbus at 3,0/SUNW,fas at 3,8800000/sd at 3,0
2. c0t4d0 <SUN18G cyl 7506 alt 2
2024 Sep 22
2
store list objects in data.table
Thanks everyone for their responses.
My data is organized in a data.table.? My goal is to perform analyses
according to some groups.? The results of analysis are objects.? If
these objects could be stored as elements of a data.table, this would
help downstream summarizing of results.
Let me try another example.
carsdt <- setDT(copy(mtcars))
carsdt[, unique(cyl) |> length()]
#[1] 3
2011 Aug 19
2
display only the top-right half of a correlation matrix?
Dear all
Is there an easy way to display only one half (top-right or
bottom-left) of a correlation matrix?
> require(Hmisc)
> rcorr(as.matrix(mtcars[ , 1:4]))
mpg cyl disp hp
mpg 1.00 -0.85 -0.85 -0.78
cyl -0.85 1.00 0.90 0.83
disp -0.85 0.90 1.00 0.79
hp -0.78 0.83 0.79 1.00
n= 32
P
mpg cyl disp hp
mpg 0 0 0
cyl 0 0 0
disp 0 0
2003 Jun 29
1
vinum drive referenced / disklabel inconsistency
I am trying to setup vinum on a box using 4.8 RELENG_4 (as of about a
week ago snapshot). This box was running 4.6 /w vinum on same hard
drives for the last 4 months wonderfully... but since it is my
current 'scratch/backup' box, I just reinstalled with -STABLE.
# uname -a
FreeBSD polya.axista.com 4.8-STABLE FreeBSD 4.8-STABLE #22: Tue Jun 24
17:01:07 EDT 2003
2020 Apr 16
2
suggestion: "." in [lsv]apply()
I'm sure this exists elsewhere, but, as a trade-off, could you achieve
what you want with a separate helper function F(expr) that constructs
the function you want to pass to [lsv]apply()? Something that would
allow you to write:
sapply(split(mtcars, mtcars$cyl), F(summary(lm(mpg ~ wt,.))$r.squared))
Such an F() function would apply elsewhere too.
/Henrik
On Thu, Apr 16, 2020 at 9:30 AM
2009 Aug 28
1
problem plotting with ggplot2
Dear R-Help subsribers,
upon running into a wonderful ggplot2 package by accident, I abruptly
encountered another problem. Almost every command run with ggplot2 results
in some sort of error. The one below is far the most common one. Kind people
from ggplot2 mailing list couldn't manage to solve the problem, so I'm
re-posting it here to try my luck. I will recommend myself for any tips
2013 Nov 03
1
FreeBSD 10 Beta 2: make installkernel failure with installer provided ZFS configuration.
Hi,
I was trying to rebuild world on a FreeBSD 10 test system, that I had just
installed. ZFS root was setup. I let the installation program do all the
ZFS setup and configuration. I put root on a 5 disk encrypted raidz array.
Besides the installer configuring 5 times the amount of swap space I asked
for (asked for 8gb, installer put 8gb on each drive, for 40gb in total.)
everything was working
2011 Aug 19
1
Hmisc::rcorr on a 'data.frame'?
Dear all
?Hmisc::rcorr states that it takes as main argument "a numeric
matrix". But is it normal that it fails in such an ugly way on a data
frame? (See below.) If the function didn't attempt any conversion to a
matrix, I would have expected it to state that in the error message
that it didn't accept 'data.frame' objects in its input. Also, I
vaguely remember having used