1

I have a smallish matrix and I want to do imshow with it with interpolation='nearest'. But this makes discrete square blocks. Is it possible to make the blocks circular and also control the size of the block?

4

1 回答 1

2

所有imshow的情节都是为了填充情节的空间而设计的(“im”是image的缩写,images填充情节空间),这与你想要绘制圆圈的愿望不一致。

网格中的散点图将是通往圆形网格的简单路线。这是一个例子:

在此处输入图像描述

from pylab import *

N = 10
r0 = 0.6
x = linspace(0, 1, 10)
y = linspace(0, 1, 10)
X, Y = meshgrid(x, y)
size = rand(N,N)
c = size
scatter(X,Y,s=700*size, marker='o', c=c)

show()

如果您使用绘图原语,您可以获得更多控制。来自 matplolib 库的两个这样的示例在此处此处

于 2013-08-03T16:15:34.353 回答