Displaying 20 results from an estimated 2000 matches similar to: "plot.dendrogram() plot margins"
2005 Oct 23
1
Coloring leaves, twigs and labels in plot.dendrogram()
Core developers,
I couldn't find any simple way to send a vector of colors to apply to each
terminal in plot.dendrogram() or plot.hclust()---I asked R-help about it a
few weeks ago and didn't get any response---so I hacked that functionality
into the plot.dendrgram code (see below for hacked function plus
examples)....
Is there any chance this functionality could be added to the
2004 Oct 21
3
error in plot.dendrogram (PR#7300)
Hi,
hres <- hclust(smatr,method="single")
hresd<-as.dendrogram(hres)
as.dendrogram(hres)
`dendrogram' with 2 branches and 380 members total, at height 2514.513
plot(hresd,leaflab="none") #<-error here.
#the plotted dendrogram is incomplete. The x axis is not drawn.
#The interested reader can download the
save(hresd,file="hres.rda")
#from the
2007 Jun 13
2
Formatted Data File Question for Clustering -Quickie Project
I am trying to learn how to format Ascii data files for scan or read
into R.
Precisely for a quickie project, I found some code (at end of this
email) to do exactly what I need:
To cluster and graph a dendrogram from package (stats).
I am stuck on how to format a text file to run the script.
I looked at the dataset USArrests (which would be replaced by my data
and labels) using UltraEdit. That
2011 Sep 26
0
horizontal labels for a dendrogram
Dear R-help list,
I'd like to create visualize the clustering of a dataset with a
dendrogram. I'm using the following script:
data = read.table("data.csv", header=T, sep=";")
require(cluster)
res = as.dendrogram(agnes(data))
chlab <- function(n) {
if(is.leaf(n)) {
att <- attributes(n)
labx <- data$category1[att$label]
lab_color <- ifelse(labx ==
2008 Jun 02
1
Plotting horizontal dendrograms
I am using hclust and plot to produce dendrograms. Using my input data I am
able to complete an analysis and obtain a vertical plot.
I want to be able to plot the dendrogram horizontally.I am using version 2.6
of R and have updated my packages recently.
Using the sample script for dendrograms I can produce a horizontal plot
using the instruction horiz = TRUE in plot().
When I use the same
2004 Dec 15
1
hclust and heatmap - slightly different dendrograms?
Good afternoon,
I ran heatmap and hclust on the same matrix x (strictly, I ran
heatmap(x), and hclust(dist(t(x))), and realized that the two
dendrograms were slightly different, in that the left-right
arrangement of one pair of subclusters (columns) was reversed in the
two functions (but all individual columns were grouped correctly).
Looking through the code for heatmap as a most definite
2004 Jul 19
1
Dendrogram plotting options?
Hi, I was wondering if there is more flexibility in the output of
dendrograms when plotting a hclust object. I can't seem to find
information on how to change the default output of a "hanging" style
tree with the axis on the right to a left-to-right plot with and axis
on the bottom. Example code follows:
library(vegan) #loads the "vegan" module that compuptes ANOSIM
2008 Nov 21
2
Dendrogram labels
Is there any way to change the orientation of the labels on the end of the dendrograms to horizontal rather than vertical? If so, how can I do that.
_____________________________________________
Patrick Richardson
Biostatistician - Program of Translational Medicine
Van Andel Research Institute - Webb Lab
333 Bostwick Avenue NE
Grand Rapids, MI 49503
ph. 616.234.5787
This email message,
2010 Apr 17
2
Interacting with dendrogram plots, locator() or click()
I would like to explore dendrogam plots interactively. For example, click on a node and return information about all of the children of that node.
Is there a high level wrapper for locator() or click() that will return the nearest dendrogram node on a plot?
If not, is there a way to obtain the [x,y] coordinates of all the nodes on a plot?
Thanks,
David
David J. States, M.D., Ph.D.
Professor
2008 Jul 24
1
plot.dendrogram xlim/ylim
list(...),
I would like to zoom in to the leaves of large trees in a dendrogram
plot. The playwith package allows zooming by passing xlim and ylim
arguments to the plot call (Hmisc does this too I think). But
currently stats:::plot.dendrogram does not accept xlim or ylim. So I
would like to enable that. In place of the existing code chunk:
xlim <- c(x1 - 1/2, x2 + 1/2)
ylim <- c(0,
2010 Dec 08
1
Formatting 'names.arg' in barplot
Hello,
I've been looking through ?phantom and ?expression and this forum for
examples of how I might be able to manipulate some of the names that appear
on the y-axis of the barplot below. For example, the "gw" in "ECgw" would
appear as a subscript...or "qr" would be the theta symbol followed by
subscript "r". My attempts haven't even come close
2009 Jun 19
1
Drawing dendrogram
Dear all,
I would like to draw a dendrogram and mark some parts/branches (by using "segments") including their labels. If I draw it without specifying the length of x axix, I am able to do that (as in My dendrogram 1 of the following codes). However, if I want to specify the x axix, I am not able to draw marking line (by using "segments") including labels (as in My dendrogram
2001 Sep 08
0
barplot forces xpd=TRUE (PR#1088)
<<insert bug report here>>
barplot hardcodes xpd as "TRUE" causing the bars to go outside of the
plot region. True can be the default, but it shouldn't be the only
option.
*** barplot.R Sat Sep 8 10:15:16 2001
--- barplot.R.orig Sat Sep 8 10:03:39 2001
***************
*** 5,11 ****
legend.text = NULL, beside = FALSE, horiz = FALSE,
col =
2008 May 06
1
Dendrogram label size
Is it possible to resize the labels in a dendrogram without applying
circles and triangles to edges?
I tried cex.labels:
plot(scoreDendogramObj, horiz=TRUE, axes=FALSE, cex.labels=0.8)
but that didn't have any effect.
Thanks,
Alex
2004 May 06
1
question about plot.dendrogram
hi all,
i'm trying to plot a dendrogram with labeled leaves
>rownames(f)<-v.names
>v<-rowMeans(f, na.rm=T)
>clust<-hclust(dist(v))
>dend<-as.dendrogram(clust,hang=0.05)
>clust2<-cut(dend, h=0.5)
>class(clust2$low[[1]])
>[1] "dendrogram"
then
>plot(clust2$low[[1]],horiz=TRUE,frame=F,type = "tr"))
but my leaf labels do not fit
2012 Jun 28
0
neatmap - draw.dendrogram - help!
Hi all,
I'm having a problem where by I'm trying to use the NeatMap draw.dendrogram
function as it is more versatile in placement/direction of dendrograms,
instead of the limited plot function.
Using plot I can get my dendrograms to display the species name for each
leaf of the tree. But I cannot figure out how to make this happen using
draw.dendrogram..
genetic<-
2007 Aug 30
1
Barplot2 using for loop, how to adjust margins?
Hi R-users,
I inted to make multiple plots using for loop. The question is how can
I adjust the left hand side margin of the plot according to the
names.arg argument in barplot2. In every plot I have different
annotations in the y axis and they vary in length. Now when I have
fixed margins
opar <- par(mar=c(3,15,0,2)...
I get the same margins in all of the plots. That leaves lots of white
2009 Jul 29
1
Drawing lines in margins
Hi all,
Quick question: What function can I use to draw a line in the margin of a plot? segments() and lines() both stop at the margin.
In case the answer depends on exactly what I'm trying to do, see below. I'm using R v. 2.8.1 on Windows XP.
Cheers,
Alan
I'm trying to make a horizontal barplot with a column of numbers on the right side. I'd like to put a line between the
2010 Jan 12
1
barplot: border color when stacked
Dear R-users,
I am using R version 2.10.1 under windows.
In a barplot, I want to mark one of the bars with a special border color.
For example:
barplot(c(3, 7, 11), border = c(NA, "red", NA))
But how to do this when the bars are stacked?
for example:
barplot(matrix(1:6, ncol=3)) # border of second bar (i.e. the one with total height = 7) should be red again, I try:
barplot(matrix(1:6,
2008 Nov 08
0
Bug in plot.dendrogram, and how to submit patches
Hello,
Before submitting a bug report, I thought I would ask here, as
recommended in http://www.r-project.org/posting-guide.html.
Using R 2.8.0 under Mac OS X, I find that edge labels are misplaced
when doing plot.dendrogram(..., horiz=TRUE), for example
> sessionInfo()
R version 2.8.0 (2008-10-20)
i386-apple-darwin8.11.1
locale:
en_GB.UTF-8/en_GB.UTF-8/C/C/en_GB.UTF-8/en_GB.UTF-8