Displaying 20 results from an estimated 10000 matches similar to: "ggplot2: setting global graphic parameters with png driver"
2008 Apr 29
2
ggplot2: labels and breaks order does not match and I can't use scale_fill_identity
Hi,
I'm plotting a bar chart like this:
ggplot() +
geom_bar(data=res,aes(fill=f1,x=f2,y=y),stat="identity",position="dodge")
f1 contains quite a few levels and the plot is really quite difficult to
read when the order of bars on the graph and on the legend does not match.
This problem has been discussed recently here:
2008 May 06
1
ggplo2: x_discrete labels size/direction
Hi everyone,
I've got quite a few labels along the x axis and ggplot2 basically just
crams them on top of each other.
Is it possible to reduce the font size and/or text direction?
Stretching the "windows" device window manually also helps, but I found that
setting the parameters for the pdf device (where my scripts should print the
data), such as paper="a4r" just results
2007 Jun 17
1
[ggplot2] Change color of grid lines
Hi,
I am making myself familiar with ggplot2 (I really like the examples
at <http://had.co.nz/ggplot2/>).
One thing that really annoys me is the default use of white grid
lines and a gray background [1, 2]. I simply would like to have black
grid lines and a white background. No problem, I thought, "This is R.
There is no if. Only how." (fortune("Simon Blomberg")).
2013 May 21
1
Lattice, ggplot, and pointsize
Hi!
When inserting R plots into a document using odfWeave, I fought for a
while to get Lattice plots use the same text size as base plots. I
eventually discovered that specifying a point size via e.g.
svg(pointsize=10) has no effect on Lattice plots. One needs to adjust
the size manually via:
trellis.par.set(fontsize=list(text=10, points=8))
This is also developed for both Lattice and ggplot2 by
2009 Feb 04
0
Two issues with ggplot2 - grid.gedit doesn't work from source file & grid.gedit effects are not preserved
Code for this post is shown below.
Two issues:
(1) grid.gedit doesn't work from source file
Reproduce - copy the code shown below into an R source file, and of course save off in the appropriate location. Then copy the the first line "source("C:/TestCode.R")" into R and run. Notice that you get the following error:Error in editDLfromGPath(gPath, specs, strict, grep,
2008 May 07
1
Not to draw the xaxis ticks in ggplot2
>library(ggplot2)
>(p<- qplot(mpg, wt, data=mtcars))
What I am doing is to set color of the ticks to hide them.
>grid.gedit(gPath("xaxis", "ticks"), gp=gpar(col="white"))
It should be a better way to achieve the purpose. Thanks.
2007 Nov 21
1
ggplot2 axis labels
Hi:
Does anyone(Hadley?)know how to change the axis labels
with the new version of ggplot2? With the old version
I used the code below:
grid.gedit("label", gp=gpar(fontsize=10, col="blue"))
Thanks
Felipe D. Carrillo
Fishery Biologist
US Fish & Wildlife Service
California, USA
2008 Jun 10
1
Sweave, ggplot2 and two-page figures
I am using Sweave to generate a document in which ggplot2 figures are
embedded. I am using the following code in a particular plot within a
subfloat environment:
<<qplotARbosreg, echo = FALSE, fig = TRUE>>=
print(qplot(bosday2, Arday2, data= arbostimearonlyNArm,
colour=factor(bos2), shape=factor(bos2), size=factor(cumARscore),
position="jitter", main="Days to BOS by
2008 Jan 26
2
using facet_grid() from ggplot2 with additional text in labels
Hi
I am using ggplot2 at the moment and I must say it is definitely better
then ggplot - good work.
My problem is that I am using facet_grid() in the following way:
> p <- ggplot(ssq, aes(x=year, y=-log(ssq)))
> p + geom_point() + facet_grid(me*gi~cs*rz)
and it works nicely, except that I would like to have, in naddition to
the values of me, gi, cs and rz the name of the variable.
2004 Sep 30
2
pointsize in png graphics
Dear all,
I'm trying to produce 2 png files, one consisting of an image plot and a
color-table (also an image plot) and the other one consisting of 4 image
plots and a color table. I'd like the color table to be exactly the same.
The way I proceded is the following:
for one plot and the color-table
png(file = png.file, width = 650, height = 800, pointsize = 16)
layout(matrix(c(1, 2),
2012 Feb 01
1
ggplot2(0.9.0): could not find function "=="
Hi,
I have a question related to the newest version of ggplot2 (0.9.0). I
just updated this morning and from CRAN it looks like the Mac version
is the only one at 0.9.0 as of right now.
http://cran.r-project.org/web/packages/ggplot2/index.html
Anyway, I was in the midst of a project where I was trying to
replicate "Back-to-back Bar Charts" in this blog post.
2008 Apr 04
1
How to access the attributes of a ggplot?
Hi,
I am having some hard time figuring how to access (and modify) the
properties of an object created by ggplot.
I found 'ggopts', but it only returns some of the properties. Say I
want to get the x- and y-axis limits, the tickmark locations, legend
current position, the legend box and background color and set them to
new values.
Are these properties easily accessible (and modifiable)
2009 Sep 29
3
sort dates within a factor
Dear List,
I have the following data:
>>
test <- data.frame(date =
as.Date(c('2007-01-01','2008-03-24','2003-03-02','2008-05-03','2002-05-23','2001-06-30','2005-12-04')),
nr = c(2000,2000,2000,2001,2002,2003,2003))
test
date nr
1 2007-01-01 2000
2 2008-03-24 2000
3 2003-03-02 2000
4 2008-05-03 2001
5 2002-05-23 2002
6
2018 Jan 19
0
Split charts with ggplot2, tidyquant
Hi Charlie,
Thanks. This is helpful. As mentioned in my original question, I want to be
able to plot a few such charts on the same page,
say a 2 x 2 grid with such a chart for each of 4 different stocks. Using
your solution I accomplished this by making
a list pLst of your ggplots and then calling cowplot::plot_grid(
plotlist=pLst, nrow=2, ncol=2 ) That worked fine.
The one issue I have is that
2011 Jun 16
1
Placing Text on ggplot2 graphics vs. xyplot
Greetings to the help mailing list.
I am in the process of translating a large graphic from xyplot to ggplot2 (13 columns by about rows).
I have been unsuccessful trying to understand how to place the following text strings after three days of:
* Perusing Wickham's "gg2plot" book;
* Searching his site for gg2plot and qplot;
* Reviewing the "man pages" for gg2plot;
*
2003 Mar 10
2
graphics backgrounds from gray to white in png()
Hi,
I'm trying to make a png file of a histogram. I would like a white
background in the final product but end up producing a gray one, despite
setting what I think are the correct parameters. Suggestions for how to
properly set a white background would be welcome.
Thanks in advance,
Scot
# for non-lattice
> par("bg"="white")
> par("bg")
[1]
2010 Apr 13
2
Help required with png graphic production as text has shadows?
I have produced a series of graphs with the png command, however when I have finally printed these out the black text appears to have a colour shadow with blue or red on either side of the letter.
I tried increasing my res to 1200 and this improved it somewhat, but the text is still not sharp and occassionally these "shadows" will still print.
I initially thought this was an issue with
2018 Jan 17
0
Split charts with ggplot2, tidyquant
A very common chart in the financial markets is a split chart with two time
series shown in two vertically stacked sub-charts.
A classic case would be the top panel showing the time series of historical
prices of some stock, and the bottom
panel showing the volume traded per day immediately below it. The common
x-axis is the dates of the time period covered.
I would like to create such a standard
2008 May 12
2
ggplot2: font size mismatch for pdf output
Hi
In the following, the graph I see on the screen and the .png output
coincide. However, in the .pdf file, the fonts seem to be scaled
fairly larger, resulting in the label for the top legend disappearing.
Is this an infelicity or bug, or is there something I've missed?
More generally, how do I control the size of fonts used in legends
and axis labels?
library(car)
library(ggplot2)
qp
2018 Jan 21
1
Split charts with ggplot2, tidyquant
Thanks for the reminder about lattice! I did some searching and there's
a good example of manipulating the size of subplots using the `position`
argument (see pp. 202-203 in the Trellis Users Guide:
http://ml.stat.purdue.edu/stat695t/writings/Trellis.User.pdf). This is
not within the paneling environment with the headers like in other
trellis plots though, so you'll have to do a bit