自动确定图例的位置 [英] Automatically determine position of plot legend

查看:168
本文介绍了自动确定图例的位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您可以在大多数绘图程序手动定位的关键传奇。例如,在gnuplot的它的使用做了设置键右上方。在GGPLOT2,它的完成这样

You can position the key legend manually in most plotting programs. For example, in gnuplot it's done using set key top right. In ggplot2, it's done like this.

有一个绘图库,脚本或简单的算法,自动定位传说,使其重叠在图中的数据最小?

Is there a plotting library, script, or simple algorithm that automatically positions the legend such that it overlaps the data in the plot minimally?

我的意思是:假设我绘制行 Y = X 。在这种情况下,传说中的好地方是左上角或右下角。

What I mean is: Suppose I plot the line y=x. A good place for the legend in that case would be top left or bottom right.

推荐答案

试试这个,

require(Hmisc)
?largest.empty

有在R-帮助档案馆提出的其他讨论和功能

there are other discussions and functions proposed in R-help archives

这篇关于自动确定图例的位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆