Skip to content

Commit

Permalink
updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
KatyBrown committed Mar 28, 2024
1 parent 085f02f commit 9faf7ba
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 3 deletions.
7 changes: 6 additions & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,9 @@ sphinx:
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
python:
install:
- requirements: man/requirements.txt
- requirements: man/requirements.txt

steps:
- command: |
pip install -r man/requirements.txt
sphinx-build -b html man/_build man
Binary file added examples/from_string.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 added man/pages/examples/from_string.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions man/pages/examples/primates.nw
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
((((((Cercopithecus neglectus:0.089332,Macaca mulatta:0.086881)1:0.046493,Colobus angolensis:0.135485)1:0.086552,((Hylobates lar:0.042152,Nomascus leucogenys:0.043098)0.52:0.066886,((Gorilla gorilla:0.041841,(Homo sapiens:0.039953,Pan troglodytes:0.030598)1:0.015261)1:0.036137,Pongo abelii:0.084649)1:0.027204)1:0.064662)1:0.094920,((Lagothrix lagotricha:0.094932,Saimiri boliviensis:0.156272)1:0.011861,Chiropotes satanas:0.093527)1:0.167153)1:0.162404,Tarsius syrichta:0.291270)1:0.024775,(Lemur catta:0.238657,(Loris tardigradus:0.185772,Galago moholi:0.171305)1:0.159023)1:0.044877):0.01;
51 changes: 49 additions & 2 deletions man/pages/parameters.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# Parameters
# Usage and Parameters

Detailed descriptions of all parameters are provided below.


*Required*

* [tree](#tree) - tree file
Expand Down Expand Up @@ -33,12 +32,60 @@ Detailed descriptions of all parameters are provided below.
* [line_width](#line-width) - set line width
* [bold](#bold) - highlight tip labels in bold

The primate tree used in these examples is from the [10K trees](https://10ktrees.nunn-lab.org/) project and is illustrative only.



## Required
### `tree`
(`str`, Required)

Either the path to a newick formatted tree or a string containing a newick formatted tree.

e.g.
A string containing a newick formatted tree

```
# Store the newick data as a string
tree = "((A:0.1,B:0.2)0.5,C:0.3)0.95:0.1;"
# Generate a matplotlib figure
f = plt.figure(figsize=(5, 5))
# Add an axis
ax = plt.subplot()
# Set the axis limits
ax.set_xlim(-1, 15)
ax.set_ylim(-5, 11)
# Visualise the tree
results = plot_phylo.plot_phylo(tree, ax)
# Save the image
f.savefig("examples/from_string.png", bbox_inches='tight')
```
![from_string](examples/from_string.png)

A file containing a newick formatted tree, such as [primates.nw](examples/primates.nw).

```
# Generate a matplotlib figure
f = plt.figure(figsize=(8, 10))
# Add an axis
ax = plt.subplot()
# Plot the tree on this axis, `examples/primates.nw` is the path to the tree
results = plot_phylo.plot_phylo("examples/primates.nw", ax)
# Save the image
plt.savefig("examples/basic_plot.png", bbox_inches='tight')
```
![Basic Tree](./examples/basic_plot.png "Basic Tree")

### `ax`
(`matplotlib.axes._axes.Axes`, Required)

Expand Down

0 comments on commit 9faf7ba

Please sign in to comment.