Is there a library for labeling scatter plot while avoiding label overlaps?

17 ビュー (過去 30 日間)
Chi Leung Wong
Chi Leung Wong 2018 年 12 月 4 日
編集済み: oliver 2022 年 6 月 21 日
I would like to plot many data points in a scatter plot and some data points are located very close together. Is there a library for smart label placement so that the label overlap will be minimized?
I found a package for R: https://cran.r-project.org/web/packages/ggrepel/vignettes/ggrepel.html which seems to provide this functionality. Is there a similar library for MATLAB?
  1 件のコメント
oliver
oliver 2022 年 6 月 21 日
編集済み: oliver 2022 年 6 月 21 日
This kind of labelling has always been cumbersome in Matlab. Nevertheless, it is astonishing that this important functionality is included in freeware like R but not in sth as expensive as Matlab. I just had to create a scatter plot of a cyclone track through the SW Indian Ocean and needed to add time & date labels to each cyclone position. In R it looks rather nice, in Matlab it is a disaster.
Matlab vs R
One workaround may be
gtextm('String')
which places the labels manually, but if you have like 30 of them this isn't much fun.

サインインしてコメントする。

採用された回答

Cris LaPierre
Cris LaPierre 2018 年 12 月 5 日
I am not aware of anything provided by MathWorks. You might look through this post, as well as looking into this file exchange function.
  1 件のコメント
oliver
oliver 2022 年 6 月 21 日
Labelpoints does not prevent the overlap of labels which is what the question was about.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMathematics についてさらに検索

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by