arklumpus / TreeViewer

Cross-platform software to draw phylogenetic trees
GNU Affero General Public License v3.0
183 stars 8 forks source link

How to make the "Scale axis" module's ticks not start at the tips? #19

Closed jrom99 closed 8 months ago

jrom99 commented 8 months ago

I have a tree with samples from 2023 and root a few centuries ago, this tree has a time axis that I configured via "Reverse axes" + "Negative ages" + offset of 2023. The ticks have a spacing of 25, with start at 0 and end at the root height. I'd like to show the scale from the root to 2023, with the ticks appearing at 25*i (ie: the first and last ticks are not at scale's edges) instead of at the current 2023 - 25*i (ie: the last tick is at the scale's end).

image

System information:

TreeViewer version 2.2.0 OS: Ubuntu 23.10 DE: GNOME Shell 45.2

arklumpus commented 8 months ago

What if you set the offset to 2027 and the start to -2? In this way the rightmost tick will be at 2025.

Alternatively, if you don't want the future date, you can do this:

  1. Figure out the age of the root node. Let's assume it's 1807.
    • If you don't have this information, you can compute it using the Compute node ages Further transformation module.
  2. In the scale axis, set these options:
    • Uncheck Reverse axes
    • Uncheck Negative ages
    • Set the offset to 1807 (or your root age)
    • Set the Tick spacing to 25
    • Set the Start to -7 (if you want the axis to start at 1800) or 18 (if you want it to start at 1825).
    • Set the End to 216 (i.e., 2023 - 1807, with the appropriate root age) This will make the axis start with a tick at the root end and end without a tick at the tips' end.

Does this work? In any case, either the start or the end tick must be aligned with the scale.

jrom99 commented 8 months ago

Thanks, it worked!