Empty boxes in treemap plot rrvgo package
1
0
Entering edit mode
Asma • 0
@asma-24876
Last seen 3 months ago
Canada

I am using the rrvgo package to plot a treemap and some boxes are empty. I was hoping to understand why this is the case? I see this happening on the plot in the rrvgo vignette as well. For example below:

treemap plot example

rrvgo • 201 views
ADD COMMENT
0
Entering edit mode
Kevin Blighe ★ 4.0k
@kevin
Last seen 1 hour ago
The Cave, 181 Longwood Avenue, Boston, …

The empty rectangles that you observe in the treemap plot generated by the rrvgo package occur because the underlying treemap package does not display labels for rectangles that are too small to accommodate the text. This behavior is intentional in the treemap package to prevent overlapping or illegible labels. The treemapPlot() function in rrvgo passes its parameters directly to the treemap() function, so it inherits this characteristic.

In the rrvgo vignette, the example treemap visualizes reduced Gene Ontology terms where rectangle sizes are proportional to the score of each term. Small rectangles represent terms with lower scores, and if their area is insufficient, the label is omitted, resulting in what appears as an empty box. The rectangle itself is not empty; it still represents a term and contributes to the overall hierarchy, with color indicating the parent term in the Gene Ontology structure.

To confirm this in your own data, inspect the reducedTerms object passed to treemapPlot(). Terms with small sizes will correspond to these unlabeled rectangles. If you wish to adjust this, you can pass additional arguments to treemapPlot(), such as fontsize.labels or force.print.labels, which are forwarded to treemap(). For example:

treemapPlot(reducedTerms, fontsize.labels = c(0, 2), force.print.labels = TRUE)

This may force labels into small rectangles, though it could lead to overlap. Alternatively, filter your input to exclude low-scoring terms before reduction using reduceSimMatrix() to produce a cleaner plot.

Kevin

ADD COMMENT

Login before adding your answer.

Traffic: 1078 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