2013-02-10 89 views
3

我试图做类似这样的如何绘制曲线可能重叠的地方?

enter image description here

,因为有彼此完全重叠,我喜欢他把传说右侧的曲线曲线图,这样他就可以画出这么多曲线没有造成混乱,并有一个单独的数字显示这些传说所代表的。

当我试图在Matlab中做这个阴谋,但我不知道如何使这样的传说。与网格双日志也是一个完整的混乱。

如何使用matplotlib或Matlab来绘制这幅图? matplotlib更灵活吗?

+0

你可以用'annotate'来做到这一点 – tacaswell 2013-02-10 18:24:55

回答

1

只要使用annotate,这应该给你90%的有:

x = np.linspace(0,1000) 
y = x ** -2 

figure() 
ax = gca() 
ax.loglog(x,y) 
ax.grid(True) 
ax.grid(True, which='minor') 

ax.annotate('a1', (x[15], y[15]), 
      backgroundcolor='w', 
      color='b', 
      va='center', 
      ha='center', 
      bbox=dict(boxstyle="round", color='b'),) 

annotate docexamples。获得圈子可能会很棘手。如果你真的想使用圈子,我会建议在github上提交一个功能请求。 (看起来像挖掘mpl胆量几个小时来添加椭圆边界框)。

+0

有趣的是,我不知道你可以用axis对象'ax.loglog(x,y)'来绘图。 – LWZ 2013-02-10 20:58:47