We introduce a versatile density-based approach to label placement that aims to put labels in uncluttered areas of an underlying 2D visualization. Our novel, image-space algorithm constructs a density map by applying kernel density estimation to the input features, i.e., the locations of the points to be labeled. In order to find a suitable position for a label where it does not overlap any features or other labels, we move it following the gradient descent of this density map. This guides labels toward nearby areas of low feature density, resulting in a layout where labels are spread around feature-dense areas. The gradient descent trajectory can be used to draw curved leaders that connect the point features to their labels. Additionally, our approach supports prioritized label placement, user-defined label-to-label and label-to-feature margins, obstacle-constrained labeling, and arbitrarily shaped labels. The proposed method is conceptually simple and can easily be implemented using OpenCV and image-processing libraries.
CITATION STYLE
Lhuillier, A., van Garderen, M., & Weiskopf, D. (2019). Density-based label placement. Visual Computer, 35(6–8), 1041–1052. https://doi.org/10.1007/s00371-019-01686-7
Mendeley helps you to discover research relevant for your work.