我正在学习matplotlib
通过学习示例来学习,并且在创建单个绘图之前,许多示例似乎包括如下所示的行...
fig, ax = plt.subplots()
Run Code Online (Sandbox Code Playgroud)
这里有些例子...
我看到这个函数用了很多,尽管这个例子只是试图创建一个图表.还有其他一些优势吗?官方演示subplots()
也用于f, ax = subplots
创建单个图表时,它之后只引用了ax.这是他们使用的代码.
# Just a figure and one subplot
f, ax = plt.subplots()
ax.plot(x, y)
ax.set_title('Simple plot')
Run Code Online (Sandbox Code Playgroud) I have a list of coordinates like
list_cor =
[[4190091.4195999987, 7410226.618699998],
[4190033.2124999985, 7410220.0823],
[4190033.2124999985, 7410220.0823],
[4190035.7005000003, 7410208.670500003],
[4190033.2124999985, 7410220.0823],
[4190022.768599998, 7410217.844300002]]
Run Code Online (Sandbox Code Playgroud)
I need to get only these values:
[[4190091.4195999987, 7410226.618699998],
[4190035.7005000003, 7410208.670500003],
[4190022.768599998, 7410217.844300002]]
Run Code Online (Sandbox Code Playgroud)
Tried numpy.unique()
but it adds this item [4190033.2124999985, 7410220.0823]
, which I don't need.