Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
a very particular plot
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Hadley Wickham  
View profile  
 More options Jul 11 2010, 9:30 am
From: Hadley Wickham <had...@rice.edu>
Date: Sun, 11 Jul 2010 15:30:21 +0200
Local: Sun, Jul 11 2010 9:30 am
Subject: Re: [R] a very particular plot
Hi Ian,

Have a look at the examples in http://had.co.nz/ggplot2/geom_tile.html
for some ideas on how to do this with ggplot2.

Hadley

--
Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University
http://had.co.nz/

______________________________________________
R-h...@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ian Bentley  
View profile  
 More options Jul 13 2010, 7:32 pm
From: Ian Bentley <ian.bent...@gmail.com>
Date: Tue, 13 Jul 2010 19:32:22 -0400
Local: Tues, Jul 13 2010 7:32 pm
Subject: Re: [R] a very particular plot
I've got a couple of more changes that I want to make to my plot, and I
can't figure things out.  Thanks for all the help.

I'm using this R script

library(ggplot2)
library(lattice)
# Generate 50 data sets of size 100 and assign them to a list object

low <- 1
n <- 50
#Load data from file
for(i in low:n) assign(paste('df', i, sep = ''),
        read.table(paste("tot-LinkedList",i*100,"query.log",sep=''),
header=TRUE))

dnames <- paste('df', low:n, sep = '')
l <- vector('list', n)
for(i in seq_along(dnames)) l[[i]] <- with(get(dnames[i]), Send + Receive)
ml <- melt(l)

dsum <- ddply(ml, 'L1', summarise, mins = min(value), meds = median(value),
              maxs = max(value))

p <- ggplot(ml, aes(x = L1*100, y = value)) +
    geom_point(alpha = 0.2) +
    geom_point(data = dsum, aes(y = mins), shape = 1, size = 3, solid=TRUE,
colour='blue') +
    geom_point(data = dsum, aes(y = meds), shape = 2, size = 3, solid=TRUE,
colour='blue') +
    geom_point(data = dsum, aes(y = maxs), shape = 3, size = 3, solid=TRUE,
colour='blue') +
    geom_smooth(data = dsum, aes(y = mins)) +
    geom_smooth(data = dsum, aes(y = meds)) +
    geom_smooth(data = dsum, aes(y = maxs)) +
    opts(axis.text.x = theme_text(size = 7, angle = 90, hjust = 1), title =
'Linked List Query Costs Increasing Network Size')  +
    xlab('Network Complexity (nodes)') + ylab('Battery Cost (uJ)') +

--END--

And this works great, except that I think that I am not being very R'y,
since now I want to add a legend saying that circle (i.e. shape 1) is the
minimum, and shape 2 is the med, and shape 3 is max.

I'd also like to be able to move the legend to the top left part of the plot
since that area is empty anyways.

Is there any way that I can do it easily?

Thanks
Ian

On 11 July 2010 10:29, Ian Bentley <ian.bent...@gmail.com> wrote:

--
Ian Bentley
M.Sc. Candidate
Queen's University
Kingston, Ontario

        [[alternative HTML version deleted]]

______________________________________________
R-h...@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ian Bentley  
View profile  
 More options Jul 14 2010, 10:13 am
From: Ian Bentley <ian.bent...@gmail.com>
Date: Wed, 14 Jul 2010 10:13:02 -0400
Local: Wed, Jul 14 2010 10:13 am
Subject: Re: [R] a very particular plot
Hi Dennis,

Thanks for the quick reply.
Once I removed solid = TRUE, which was giving errors, the code is accepted
fine.

It's strange though, no legend appears.  Even when I try something simple
like:
p + scale_shape_manual(values=1:3)

No legend appears.  I can't find any similar problems on google.

Thanks again,
Ian

On 14 July 2010 03:56, Dennis Murphy <djmu...@gmail.com> wrote:

--
Ian Bentley
M.Sc. Candidate
Queen's University
Kingston, Ontario

        [[alternative HTML version deleted]]

______________________________________________
R-h...@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jeff Newmiller  
View profile  
 More options Jul 14 2010, 10:45 am
From: Jeff Newmiller <jdnew...@dcn.davis.ca.us>
Date: Wed, 14 Jul 2010 07:45:42 -0700
Local: Wed, Jul 14 2010 10:45 am
Subject: Re: [R] a very particular plot
Ggplot will only produce legends based on factors. Integers are not factors.

---------------------------------------------------------------------------
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnew...@dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
---------------------------------------------------------------------------
Sent from my phone. Please excuse my brevity.

______________________________________________
R-h...@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ista Zahn  
View profile  
 More options Jul 14 2010, 1:02 pm
From: Ista Zahn <iz...@psych.rochester.edu>
Date: Wed, 14 Jul 2010 13:02:11 -0400
Local: Wed, Jul 14 2010 1:02 pm
Subject: Re: [R] a very particular plot
Hi all,
Maybe I missed some crucial context (I did not follow the example all
the way through). But of course ggplot will make legends based on
integers. For example:

dat <- data.frame(x=sample(1:10, 100, replace=TRUE),
                  y=sample(1:10, 100, replace=TRUE),
                  z=sample(1:10,100, replace=TRUE)
                  )

str(dat)

ggplot(dat, aes(x=x, y=y, color=z)) + geom_point()

-Ish

On Wed, Jul 14, 2010 at 10:45 AM, Jeff Newmiller

--
Ista Zahn
Graduate student
University of Rochester
Department of Clinical and Social Psychology
http://yourpsyche.org

______________________________________________
R-h...@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Hadley Wickham  
View profile  
 More options Jul 16 2010, 6:06 am
From: Hadley Wickham <had...@rice.edu>
Date: Fri, 16 Jul 2010 12:06:43 +0200
Local: Fri, Jul 16 2010 6:06 am
Subject: Re: [R] a very particular plot

Yes, but it's difficult to show you how without a simple reproducible example...

Hadley

--
Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University
http://had.co.nz/

______________________________________________
R-h...@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »