Closed Zoey-Aminah closed 8 months ago
Dear @Zoey-Aminah.
It looks like the problem is the size of your plotting device (and/or the size of the plotting elements, such as the label text). To verify this, try plotting to a large PDF and see if that works. To accomplish this, one normally runs something like the following code:
pdf(file="Rplot.pdf",width=12,height=12)
plotTree.barplot(myTree,exp(counts),args.plotTree = list(fsize = 0.5), args.barplot = list(xlab = "counts (mm)"))
dev.off()
This creates a 12" x 12" PDF figure. You can increase those dimensions as necessary.
-- Liam
Thank you for your help. The issue has been fixed.
Zoey
Liam J. Revell @.***> 于2023年7月12日周三 01:52写道:
Dear @Zoey-Aminah https://github.com/Zoey-Aminah.
It looks like the problem is the size of your plotting device (and/or the size of the plotting elements, such as the label text). To verify this, try plotting to a large PDF and see if that works. To accomplish this, one normally runs something like the following code:
pdf(file="Rplot.pdf",width=12,height=12) plotTree.barplot(myTree,exp(counts),args.plotTree = list(fsize = 0.5), args.barplot = list(xlab = "counts (mm)")) dev.off()
This creates a 12" x 12" PDF figure. You can increase those dimensions as necessary.
-- Liam
— Reply to this email directly, view it on GitHub https://github.com/liamrevell/phytools/issues/138#issuecomment-1631246902, or unsubscribe https://github.com/notifications/unsubscribe-auth/A6QXGP2TJ5GTB7AAL2U7BYLXPWHEFANCNFSM6AAAAAAZRA6ZFQ . You are receiving this because you were mentioned.Message ID: @.***>
Hi,
I want to produce a barplot next to a plotted tree. But the bars doesn't show.
Below is my code:
library(phytools)
load data
myTree <- ape::read.tree('longname_sptree.newick.tree') GeneCount <- read.csv('Sp_tree_counts.csv')
extract values.
keeps <- c("Counts") Counts = GeneCount[keeps] counts = setNames(Counts)
Plot
plotTree.wBars(myTree,GeneCount$Counts, type = "phylogram",scale = 0.00001) par(mar = c(5.1,4.1,4.1,2.1)) plotTree.barplot(myTree,exp(counts),args.plotTree = list(fsize = 0.5), args.barplot = list(xlab = "counts (mm)"))
And this is the error:
My figure is like this:
How can I change it? Is that the problem with my data file?
Thank you so much. Regards, Zoey