It was recently reported to me that the color gradient legend labels in the
plotting method for
"contMap" are messed up. This was
evidently due to a bug I introduced the option to plot the color legend
I just pushed a bug fix (which is basically just a deletion of the introduced bug.
First, here is the bug:
library(phytools) obj<-contMap(tree,x,plot=FALSE) plot(obj,legend=2.1)
Note the rightmost legend label is 'floating' too high about the legend line.
Now the fix. Since the function
add.color.bar is called
internally, R won't use it unless we load the source code of the other
functions as well:
source("https://raw.githubusercontent.com/liamrevell/phytools/master/R/plotBranchbyTrait.R") source("https://raw.githubusercontent.com/liamrevell/phytools/master/R/densityMap.R") source("https://raw.githubusercontent.com/liamrevell/phytools/master/R/contMap.R") plot(obj,legend=2.1)
This can also be installed from GitHub of course: