|
From: <kk...@us...> - 2011-02-08 22:17:25
|
Revision: 92
http://python-control.svn.sourceforge.net/python-control/?rev=92&view=rev
Author: kkchen
Date: 2011-02-08 22:17:17 +0000 (Tue, 08 Feb 2011)
Log Message:
-----------
Modified freqplot to plot magnitude and phase in same color; included keyword color=None, so that bode can specify color.
Steven Brunton <sbr...@pr...>
Modified Paths:
--------------
branches/control-0.4a/src/freqplot.py
Modified: branches/control-0.4a/src/freqplot.py
===================================================================
--- branches/control-0.4a/src/freqplot.py 2011-02-08 22:17:13 UTC (rev 91)
+++ branches/control-0.4a/src/freqplot.py 2011-02-08 22:17:17 UTC (rev 92)
@@ -54,7 +54,7 @@
#
# Bode plot
-def bode(syslist, omega=None, dB=False, Hz=False):
+def bode(syslist, omega=None, dB=False, Hz=False, color=None):
"""Bode plot for a system
Usage
@@ -111,10 +111,16 @@
# Magnitude plot
plt.subplot(211);
if dB:
- plt.semilogx(omega, mag)
+ if color==None:
+ plt.semilogx(omega, mag)
+ else:
+ plt.semilogx(omega, mag, color=color)
plt.ylabel("Magnitude (dB)")
else:
- plt.loglog(omega, mag)
+ if color==None:
+ plt.loglog(omega, mag)
+ else:
+ plt.loglog(omega, mag, color=color)
plt.ylabel("Magnitude")
# Add a grid to the plot
@@ -124,7 +130,10 @@
# Phase plot
plt.subplot(212);
- plt.semilogx(omega, phase)
+ if color==None:
+ plt.semilogx(omega, phase)
+ else:
+ plt.semilogx(omega, phase, color=color)
plt.hold(True)
# Add a grid to the plot
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|