Python Material Installation Dokumentation PythonKara Grundlagen Namensräume Funktionen Testen Strings Dictionary Listen Zeitmessungen Zufall Bits+Bytes Module Sockets xml serielle Schnittstelle Python in HTML Turtle xturtle Tkinter OOP Threads Zusicherungen exe Patterns GnuPlot Goto MySQL CGI Dateien Exceptions Grafik Mathematik Fischertechnik Unicode funktional Iterator Sound C Debugger regex Pfade Docstrings Django Bluetooth format Bytecode signal
Pfad: Startseite / Fächer / Informatik / Python / GnuPlot
Autor: mk
27.01.2009 15:28
3670
GnuPlot mit Python

Einfaches GnuPlot-Interface

# -*- coding: iso-8859-1 -*-
# mk, 21.12.08

# model
import Gnuplot, Gnuplot.funcutils
g = Gnuplot.Gnuplot(debug=1)

# control
def ein(event):
    s = e1.get()
    g(s)


# view
from Tkinter import *
f = Tk()
f.title('einfaches Gnuplot-Interface')
f.geometry('300x200')
e1 = Entry(master=f)
e1.insert(0,'splot \'a64a31.txt\' with lines,\'a64a32.txt\' with lines;')
e1.place(x=20,y=20,width=250)
bAdd = Button(master=f,text='führe aus')
bAdd.place(x=20,y=50, width=50)
bAdd.bind('<Button-1>',ein)
f.mainloop()

Beispiel 0 plot0.py, a64a31.txt, a64a32.txt

GnuPlot-Interface zu 3D-Darstellungen zur Vektorrechnung

Das Python-Programm plot1.py ermöglicht in Verbindung mit Gnuplot und dem Gnuplot-Python-Interface auf einfache Art, 3D-Darstellungen von Punkten, Linien und Pfeilen zu erzeugen. Das Programm erzeugt temporäre Dateien, dh. man kopiert es zur Benutzung am besten in ein Verzeichnis, wo man Schreibrechte hat und nicht von anderen gestört wird.

Zur Erinnerung: Gnuplot erlaubt, die jeweilige Ansicht mit der Maus zu variieren.

GUI zu plot1

Beispiel 1

Installation

Links

Valid XHTML 1.0!