I'm trying to create a scatterplot that describes certain subjects by
four attributes. I'll use the two Cartesian axes for the two key
attributes and color for the third. As I want to use the subject
names as entries in the scatterplot, I'll highlight the few I want to
emphasize (the fourth attribute) with the size attribute.
I could use colored or shaped points for each subject and use a
legend to associate the aesthetics with the subject names, but, with
ca. 24 subjects, that keeps the viewer jumping back and forth between
the legend and the graph.
My challenge is to make the graph readable. At readable sizes for
subject names, the names tend to land on top of each other. If I
shrink the size of the names to avoid overlapping, I need a magnifying
glass to make sense of them. I've tried (perhaps unskillfully)
jitter, dodge and stack, to no avail. Is there a clever way to
eliminate the overlap?
I'm open to colored dots with their names floating nearby. The dots
wouldn't need to be jittered much if at all, and the color could make
the association, but I don't know how to ensure the names don't
exhibit any overlap.
Here's a sample command sequence:
q <- ggplot(stats,
aes(x=abscissa,y=ordinate,label=SubjectName,size=factor(FinalAttribute),color=factor(Type)))+scale_size_manual(values=c(2,3))+scale_colour_brewer(type="seq",palette="Set1")
> q+geom_text(vjust=0.5,hjust=-0.25)+geom_point()+scale_x_continuous(limits=c(0,5e6))
I also have had problems with label text running off the plot. I know
I could use subsetting and hjust
(
http://stackoverflow.com/questions/1939098/repositioning-scatter-plot-labels-in-ggplot2),
but that seems to make the overlap problem more challenging.
Currently I have expanded scale_x_continuous. Is there a better way?
Any advice is welcome.
Thanks,
Bill
--
Bill Harris
--
You received this message because you are subscribed to the ggplot2 mailing list.
To post to this group, send email to
ggp...@googlegroups.com
To unsubscribe from this group, send email to
ggplot2+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/ggplot2