如何在matplotlib中将颜色设置为Rectangle?我尝试使用参数颜色,但没有成功.
我有以下代码:
fig=pylab.figure()
ax=fig.add_subplot(111)
pylab.xlim([-400, 400])
pylab.ylim([-400, 400])
patches = []
polygon = Rectangle((-400, -400), 10, 10, color='y')
patches.append(polygon)
p = PatchCollection(patches, cmap=matplotlib.cm.jet)
ax.add_collection(p)
ax.xaxis.set_major_locator(MultipleLocator(20))
ax.yaxis.set_major_locator(MultipleLocator(20))
pylab.show()
Run Code Online (Sandbox Code Playgroud) 我得到 p12
var p12Der = ...
var p12Asn1 = forge.asn1.fromDer(p12Der);
var p12 = forge.pkcs12.pkcs12FromAsn1(p12Asn1, password);
Run Code Online (Sandbox Code Playgroud)
我如何从证书中获取信息,例如主题名称、发行人名称、序列号...
我有以下结构,并想在(UserId 和 Contact)上创建唯一索引。这在gorm中可能吗?
type Contact struct {
gorm.Model
UserId uint `gorm:"index;not null"`
Contact string `gorm:"type:text;not null"`
}
Run Code Online (Sandbox Code Playgroud)
我想创建类似的表
CREATE TABLE contact (...column definitions ...)
CONSTRAINT constraint1
UNIQUE (user_id, contact)
Run Code Online (Sandbox Code Playgroud)