Wie man glatte Kontur gefüllt in matplotlib?

Hallo, ich Versuch Grundstück eine gefüllte Kontur des unebenen Daten. die ist in drei Listen. Mein problem hier ist, kann ich nicht in der Lage zu bekommen glatte Kontur gefüllt. was ich gemacht habe ist zuerst änderte ich meine Daten aus eine unregelmäßige Punkte auf einem raster mit griddata.

import numpy as np
import matplotlib.pyplot as plt
import time as time
from scipy.interpolate import griddata
x = [39, 39, 603, 603, 540.8578720591851, 586.349172503832, 373.99215228030187, 436.4554443169055, 125.7177128362948, 56.44720056160912, 453.35159098310174, 384.081128192362, 51.846094630755104, 121.11660875746472, 278.0734642496455, 211.33415130113278, 508.642428513517, 453.0506702655636, 455.66065332357397, 381.7443137710119, 211.08060937414135, 271.19278437560484, 301.7212739516758, 337.50499942076925, 237.27644459337762, 277.8143694411149, 89.76821876085899, 145.66110067318877, 151.97990283138796, 197.59696541916784, 398.0895764975718, 453.7365065456195]
y = [-29, 394, -29, 394, 96.31199431392861, 96.31199431392861, 65.63484056949213, 65.63484056949213, 353.9802948050525, 353.99631296027843, 354.83809861715105, 354.75376513965614, 170.85745938538898, 170.85745938538898, 156.95287962269862, 156.95287962269862, 161.4804871844196, 160.98633822221555, 242.17985596076556, 241.74154302501933, 214.02665403095247, 214.02665403095247, 65.63484056949213, 65.63484056949213, 63.49457402918261, 63.49457402918261, 54.22008568784131, 54.22008568784131, 7.134221801031751, 7.134221801031751, 3.5671109005158756, 3.5671109005158756]
z = [0, 0, 0, 0, 1, 1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
extent = (min(x), max(x), min(y), max(y))
xs,ys = np.mgrid[extent[0]:extent[1], extent[2]:extent[3]]
resampled = griddata((x, y), z, (xs, ys))
plt.figure()
plt.imshow(resampled.T, extent=(min(x), max(x), max(y), min(y)))
plt.hold(True)
plt.scatter(x,y,c=z)
plt.show()

gibt plot wie unten dargestellt.
Wie man glatte Kontur gefüllt in matplotlib?
Die Suche seltsam. Wie kann ich glatt die Farbe variation zum nächsten Punkt.
Vielen Dank im Voraus

InformationsquelleAutor lokesh | 2013-12-05

Schreibe einen Kommentar