简体   繁体   English

使用ggraph时,如果标签文本在图中重叠,如何审查数据点标签(注释)

[英]how to censor data point labels (annotations) if label text overlaps in the plot when using ggraph

I am attempting to plot some data using ggraph .我正在尝试使用ggraph绘制一些数据。 The style is a circular partition plot.样式为circular partition图。 I have numerous plots/graphs.我有很多图/图表。 Each has a different density of dendritic branching.每个都具有不同密度的树枝状分支。 Nodes on the graph are labeled with geom_node_text(aes(label = labelText)) .图上的节点用geom_node_text(aes(label = labelText)) I know I can use scaling or text size to adjust effective font point.我知道我可以使用缩放或文本大小来调整有效字体点。 However, I would like to hold font point constant and just censor labels (ie, assign label value to be something like " " ) for dense regions of each graph, given some density threshold parameter.但是,在给定一些密度阈值参数的情况下,我想保持字体点不变并且只检查每个图形的密集区域的标签(即,将标签值分配为类似于" " )。 How could this be done?怎么可能做到这一点? For instance, is there a way to extract the x, y coordinates of text labels such that a density function can be computed over the plot area?例如,有没有办法提取文本标签的x, y坐标,以便可以在绘图区域上计算密度函数?

This falls under the heading of RTFM .这属于RTFM的标题。

check_overlap
If TRUE, text that overlaps previous text in the same layer will not be plotted.如果为 TRUE,则不会绘制与同一层中先前文本重叠的文本。 check_overlap happens at draw time and in the order of the data. check_overlap 发生在绘制时间和数据的顺序。 Therefore data should be arranged by the label column before calling geom_label() or geom_text().因此,在调用 geom_label() 或 geom_text() 之前,应按标签列排列数据。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM