Skip to content

Commit

Permalink
small update to graphical params
Browse files Browse the repository at this point in the history
  • Loading branch information
wabarr committed Dec 6, 2017
1 parent 4522e78 commit 9b0ad9c
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 20 deletions.
8 changes: 5 additions & 3 deletions R/ggphylomorpho.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#' @param xlab the text label for the x axis
#' @param ylab the text label for the y axis
#' @param repel boolean indicating whether or not to use the \code{ggrepel} package to prevent overplotting of labels
#' @param edge.width size parameter for edges drawn on phylomorphospace. Default is 1
#' @return the ggplot object representing the phylomorphospace


Expand All @@ -22,7 +23,8 @@ ggphylomorpho <- function(tree,
title="Phylomorphospace",
xlab="PC1",
ylab="PC2",
repel=TRUE)
repel=TRUE,
edge.width=1)
{

require(ggplot2)
Expand Down Expand Up @@ -62,13 +64,13 @@ ggphylomorpho <- function(tree,

theplot <-
ggplot() +
geom_segment(data=edgecoords,aes(x=x.x,xend=x.y, y=y.x, yend=y.y)) +
geom_segment(data=edgecoords,aes(x=x.x,xend=x.y, y=y.x, yend=y.y), size=edge.width) +
geom_point(data=pointsForPlot, aes(x=x, y=y, color=color), size=5) +
labs(title=title, x=xlab, y=ylab) +
theme_bw(20) +
theme(legend.position='bottom')
if(repel){
theplot <- theplot + geom_text_repel(data=pointsForPlot, aes(x=x, y=y, label=label))
theplot <- theplot + geom_text_repel(data=pointsForPlot, aes(x=x, y=y, label=label), segment.alpha=0.5)
} else{
theplot <- theplot + geom_text(data=pointsForPlot, aes(x=x, y=y, label=label))
}
Expand Down
4 changes: 3 additions & 1 deletion man/ggphylomorpho.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 9 additions & 9 deletions readme.html

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ head(sampleData$DF)
```

```
## PC1 PC2 taxon group
## AAAAA 1.416156 -3.4994342 AAAAA group1
## BBBBB 2.364885 -3.1435084 BBBBB group2
## CCCCC 3.923850 -3.7085053 CCCCC group1
## DDDDD 4.779961 -3.1848266 DDDDD group2
## EEEEE 1.433133 2.9528747 EEEEE group1
## FFFFF -0.273229 -0.6153418 FFFFF group2
## PC1 PC2 taxon group
## AAAAA -1.6961220 -3.166955 AAAAA group1
## BBBBB -1.6417467 -3.020521 BBBBB group2
## CCCCC -1.2058984 -3.519850 CCCCC group1
## DDDDD -1.6926564 -1.302847 DDDDD group2
## EEEEE 1.1066959 -1.219074 EEEEE group1
## FFFFF 0.8772968 -1.233387 FFFFF group2
```

## check out the documentation for the function
Expand Down
Binary file modified readme_files/figure-html/unnamed-chunk-1-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified readme_files/figure-html/unnamed-chunk-3-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 9b0ad9c

Please sign in to comment.