Matplotlib


Eine Zusammenstellung aus fertigen Graphen und dem dazugehörigen Programmcode.
Basisdaten

Entwickler John D. Hunter
Erscheinungsjahr 2003[1]
Aktuelle Version 3.11.0[2]
(12. Juni 2026)
Betriebssystem plattformunabhängig
Programmier­sprache Python
Kategorie Programmbibliothek
Lizenz Matplotlib-Lizenz
matplotlib.org

Matplotlib ist eine Programmbibliothek für die Programmiersprache Python, die es erlaubt, mathematische Darstellungen aller Art anzufertigen.

Beschreibung

Bearbeiten

Matplotlib kann mit Python 2.x (bis Matplotlib 2.2.x) und 3.x verwendet werden und funktioniert auf allen gängigen Betriebssystemen. Dabei wird eine Python-ähnliche objektorientierte Schnittstelle verwendet. Nach dem Importieren der Bibliothek kann man graphische Darstellungen mithilfe der Python-Konsole erzeugen. Man kann jedoch auch Matplotlib in bestehende Python-Programme integrieren. Dazu verwendet Matplotlib Anbindungen zu GUI-Bibliotheken wie GTK+, Qt, wxWidgets und Tk. Die Grafiken können in einer Vielzahl von Formaten erstellt werden, z. B.: SVG, PNG, Anti-Grain Geometry, EPS, PDF.

Entwicklung

Bearbeiten

Die erste Version von Matplotlib wurde von John D. Hunter in den Jahren 2002 und 2003 entwickelt.[3] Gleich zu Beginn war es als freie Open-Source-Bibliothek gedacht. Heute wird die Entwicklung auf GitHub von vielen Personen vorangetrieben.[4]

Beispiele

Bearbeiten

Kurven

>>> import matplotlib.pyplot as plt
>>> import numpy as np
>>> a = np.linspace(0, 8, 501)
>>> b = np.exp(-a)
>>> plt.plot(a, b)
>>> plt.show()

Histogramm

>>> import matplotlib.pyplot as plt
>>> from numpy.random import normal,rand
>>> x = normal(size=200)
>>> plt.hist(x, bins=30, edgecolor='black')
>>> plt.show()

Streudiagramm

>>> import matplotlib.pyplot as plt
>>> from numpy.random import rand
>>> a = rand(100)
>>> b = rand(100)
>>> plt.scatter(a, b, edgecolor='black')
>>> plt.show()

3D-Plot

>>> from matplotlib import cm
>>> from mpl_toolkits.mplot3d import Axes3D
>>> import matplotlib.pyplot as plt
>>> import numpy as np
>>> fig = plt.figure()
>>> ax = fig.add_subplot(projection='3d')
>>> X = np.arange(-5, 5, 0.25)
>>> Y = np.arange(-5, 5, 0.25)
>>> X, Y = np.meshgrid(X, Y)
>>> R = np.sqrt(X**2 + Y**2)
>>> Z = np.sin(R)
>>> surf = ax.plot_surface(X, Y, Z, rstride=1, cstride=1, cmap=cm.coolwarm, edgecolor='black')
>>> plt.show()

Weitere Beispiele

Bearbeiten
Commons: Matplotlib – Sammlung von Bildern, Videos und Audiodateien

Einzelnachweise

Bearbeiten
  1. matplotlib.org.
  2. Release 3.11.0. 12. Juni 2026 (abgerufen am 12. Juni 2026).
  3. John D. Hunter: Matplotlib: A 2D Graphics Environment. In: Computing in Science & Engineering. 9. Jahrgang, Nr. 3, S. 90–95, doi:10.1109/MCSE.2007.55 (englisch).
  4. Matplotlib Credits. In: Matplotlib. Matplotlib, abgerufen am 7. August 2014 (englisch).

📚 Artikel Terkait di Wikipedia

Rasterung von Kreisen

plot( mx + x, my + y ); plot( mx + x, my - y ); plot( mx - x, my + y ); plot( mx - x, my - y ); plot( mx + y, my + x ); plot( mx + y, my - x ); plot(

R (Programmiersprache)

Elegant Graphics for Data Analysis. 2. Auflage. Springer, 2015, ISBN 978-3-319-24275-0 (Material).  Leland Wilkinson: The Grammar of Graphics. Springer

Xiaolin Wus Linien-Algorithmus

Artikel An Efficient Antialiasing Technique in der Ausgabe von Computer Graphics im Juli 1991 sowie im Artikel Fast Antialiasing in Dr. Dobb’s Journal vom

The Order (Gruppe)

August 2010 - abgerufen ebendann). Margot Williams, Alyson Hurt: DATA & GRAPHICS: Population Of The Communications Management Units. In: npr.org. NPR, 3

Mathematica

Sinusfunktion mit hellroter Füllung und gestrichelten Linien – erzielt, wenn man Plot[Sin[x], {x, -6.6, 6.6}, Filling -> Axis, FillingStyle -> Lighter[Red], GridLines

Lotus Software

verkaufte im Oktober 1981 die Rechte an seinen Programmen VisiPlot und VisiTrend/Plot und gründete noch im selben Monat die Lotus Development Corporation

Liste von Dateinamenserweiterungen/S

Audiodatenarchiv Enthält Audiodaten von GTA, Tomb Raider 2+3 u.v.m. .sg Snap Graphics ABC Snap Graphics (Software für Flussdiagramme) .sgb Super Game Boy ROM image Dump

Polarkoordinaten

Friendly: Milestones in the History of Thematic Cartography, Statistical Graphics, and Data Visualization. Archiviert vom Original am 25. September 2006;