1
1
//---------------------------------------------------------------------------//
2
// $Id: x04.java,v 1.8 2004/01/17 16:41:39 rlaboiss Exp $
2
// $Id: x04.java,v 1.14 2005/07/03 12:43:39 andrewross Exp $
3
3
//---------------------------------------------------------------------------//
5
5
//---------------------------------------------------------------------------//
6
6
// Copyright (C) 2001 Geoffrey Furnish
7
7
// Copyright (C) 2001, 2002 Alan W. Irwin
8
// Copyright (C) 2004 Andrew Ross
9
10
// This file is part of PLplot.
20
21
// You should have received a copy of the GNU Library General Public License
21
22
// along with PLplot; if not, write to the Free Software
22
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23
24
//---------------------------------------------------------------------------//
25
26
//---------------------------------------------------------------------------//
84
84
phase[i] = -(180.0 / Math.PI) * Math.atan(freq / f0);
87
pls.plvpor(0.15, 0.85, 0.1, 0.9);
88
pls.plwind(-2.0, 3.0, -80.0, 0.0);
87
pls.vpor(0.15, 0.85, 0.1, 0.9);
88
pls.wind(-2.0, 3.0, -80.0, 0.0);
90
90
// Try different axis and labelling styles.
95
pls.plbox("bclnst", 0.0, 0, "bnstv", 0.0, 0);
95
pls.box("bclnst", 0.0, 0, "bnstv", 0.0, 0);
98
pls.plbox("bcfghlnst", 0.0, 0, "bcghnstv", 0.0, 0);
98
pls.box("bcfghlnst", 0.0, 0, "bcghnstv", 0.0, 0);
102
102
// Plot ampl vs freq.
105
pls.plline(freql, ampl);
107
pls.plptex(1.6, -30.0, 1.0, -20.0, 0.5, "-20 dB/decade");
105
pls.line(freql, ampl);
107
pls.ptex(1.6, -30.0, 1.0, -20.0, 0.5, "-20 dB/decade");
109
109
// Put labels on.
112
pls.plmtex("b", 3.2, 0.5, 0.5, "Frequency");
113
pls.plmtex("t", 2.0, 0.5, 0.5, "Single Pole Low-Pass Filter");
115
pls.plmtex("l", 5.0, 0.5, 0.5, "Amplitude (dB)");
112
pls.mtex("b", 3.2, 0.5, 0.5, "Frequency");
113
pls.mtex("t", 2.0, 0.5, 0.5, "Single Pole Low-Pass Filter");
115
pls.mtex("l", 5.0, 0.5, 0.5, "Amplitude (dB)");
117
117
// For the gridless case, put phase vs freq on same plot.
121
pls.plwind(-2.0, 3.0, -100.0, 0.0);
122
pls.plbox("", 0.0, 0, "cmstv", 30.0, 3);
124
pls.plline(freql, phase);
126
pls.plmtex("r", 5.0, 0.5, 0.5, "Phase shift (degrees)");
121
pls.wind(-2.0, 3.0, -100.0, 0.0);
122
pls.box("", 0.0, 0, "cmstv", 30.0, 3);
124
pls.line(freql, phase);
126
pls.mtex("r", 5.0, 0.5, 0.5, "Phase shift (degrees)");