Row and coloumn names do not display on x and Y axis in heatmaply.
1
0
Entering edit mode
5.8 years ago

Row and coloumn names do not display on x and Y axis in heatmaply. Instead of row and colomn names it is showing digits.

data <- read.csv("/Users/apple/Documents/42_heatmap_new.csv", sep=",")
> rnames <- data[,1]
> mat_data <- data.matrix(data[,2:ncol(data)]) ## matrix started with second column
> heatmaply(mat_data, file="heatmaply_preformed.html", dendrogram = "none", plot_method= c("plotly"), margins = c(150,250,30,150), grid_gap = 0.1, show_grid = TRUE, xlab = "Antibiotics", ylab = "Clinical isolates", main="Heatmap for drug resistance profile of 42 complete genomes", cexCol = 0.9, cexRow = 1.0, lwid =c(4,1), lhei =c(2,2))
heatmap • 2.4k views
ADD COMMENT
0
Entering edit mode

I added code markup to your post for increased readability. You can do this by selecting the text and clicking the 101010 button. When you compose or edit a post that button is in your toolbar, see image below:

101010 Button

ADD REPLY
0
Entering edit mode

code seems to have no problem. x and y axis (xlab and ylab) names are present in output as expected. I hope you have installed phantom js via R (install via webshot::install_phantomjs()). Then add following information to your code: file = c("heatmaply_plot.html", "heatmaply_plot.png"). This should create a png file in working directory. If it has xlab and ylab, then your displaying window has issue.

ADD REPLY
0
Entering edit mode

But my code do not display all the anitbiotic names at the x axis and isolates names at y axis instead it is showing numbers like 1, 2, 3 , 4 and so on. What to do.

ADD REPLY
1
Entering edit mode
5.8 years ago

Well, title of your post is misleading. Add labRow =rnames, labCol = colnames(data[,-1] to your code at the end. First add only `labRow =rnames' to your code. See if it works. If it works, then add labcol. If it doesn't, please post example data.

ADD COMMENT
0
Entering edit mode

wow labRow =rnames works. but labCol = colnames(data[,-1] still does not work. Do not display coloumn names. Is there any other solution.

ADD REPLY
0
Entering edit mode

what is the output of names(data[,2:ncol(data)])?

ADD REPLY
0
Entering edit mode

Shwoing all antibiotics names like [1] "Amikacin" "Gentamicin"
[3] "Streptomycin" "Spectinomycin"

ADD REPLY
0
Entering edit mode

It works. Thank you so much...

ADD REPLY
0
Entering edit mode

The query has now been resolved. Thank you so much.

ADD REPLY
0
Entering edit mode

I have moved the reaction from cpad0112 to an answer so you can accept it.

ADD REPLY
0
Entering edit mode

colnames(data[,-1] ) should work. It is same as names(data[,2:ncol(data)])

ADD REPLY

Login before adding your answer.

Traffic: 1992 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6