Python matplotlib如何制作特殊标记
我正在尝试制作一个特殊的标记,该标记不能与“散布”命令一起使用。我想做一个“板针”形状的标记。原则上,arrow(在fancyarrow命令下)很好,但它不允许我使用vmin和vmax选项,这对我来说非常重要。让我解释一下 我有一组Python matplotlib如何制作特殊标记,python,matplotlib,Python,Matplotlib,我正在尝试制作一个特殊的标记,该标记不能与“散布”命令一起使用。我想做一个“板针”形状的标记。原则上,arrow(在fancyarrow命令下)很好,但它不允许我使用vmin和vmax选项,这对我来说非常重要。让我解释一下 我有一组x,y坐标和速度。速度由颜色条表示。因此,读入x,y和velocity并使用scatter vmin和vmax命令,标记将自动以正确的颜色绘制。例如: f.show_colorscale(cmap="gist_hsv",vmin=0,vmax=8e3) f.scatt
x,y
坐标和速度。速度由颜色条表示。因此,读入x,y
和velocity并使用scatter vmin和vmax命令,标记将自动以正确的颜色绘制。例如:
f.show_colorscale(cmap="gist_hsv",vmin=0,vmax=8e3)
f.scatter(x,y,c=vel,marker='o',s=50,vmin=0,vmax=8e3)
我只成功地绘制了电路板引脚的“头部”(只是一个填充圆)。你知道如何从不同角度得到板针的“尾巴”吗 也许您可以检查matplotlib.patches
In [23]: from matplotlib import patches
In [24]: patches.Arrow ?
Type: type
Base Class: <type 'type'>
String Form: <class 'matplotlib.patches.Arrow'>
Namespace: Interactive
File: c:\python26\lib\site-packages\matplotlib\patches.py
Docstring:
An arrow patch.
Constructor information:
Definition: patches.Arrow(self, x, y, dx, dy, width=1.0, **kwargs)
Docstring:
Draws an arrow, starting at (*x*, *y*), direction and length
given by (*dx*, *dy*) the width of the arrow is scaled by *width*.
Valid kwargs are:
agg_filter: unknown
alpha: float or None
.........................................
[23]中的:从matplotlib导入修补程序
在[24]:补丁。箭头?
类型:类型
基类:
字符串形式:
名称空间:交互式
文件:c:\python26\lib\site packages\matplotlib\patches.py
文档字符串:
箭片。
建造商资料:
定义:补丁。箭头(self,x,y,dx,dy,width=1.0,**kwargs)
文档字符串:
从(*x*,*y*)、方向和长度开始绘制箭头
由(*dx*,*dy*)给出,箭头的宽度按*宽度*缩放。
有效KWARG为:
agg_筛选器:未知
alpha:浮动还是无
.........................................
这么简单
plot(x,y, "o", markersize=1)