From graphics-request at octave dot org Tue Aug 10 14:08:41 2004 Subject: Re: freqz_plot alterations From: Daniel J Sebald To: graphics at octave dot org Date: Tue, 10 Aug 2004 14:32:56 -0500 This is a multi-part message in MIME format. --------------070409040903090200020605 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Here is a patch of what I suggested. -- Dan Daniel J Sebald wrote: > I've been attempting to spruce up the freqz plots. Regardless of > those changes, I offer up the suggestion of tweaking the > freqz/freqz_plot files. The issue is that inside of the freqz_plot > script, the command > > axis ([ w(1), w(n) ]); > > results in the range being forced so that the right border is not a > nice whole number in any case. Etc. --------------070409040903090200020605 Content-Type: text/plain; name="freqz_xrange.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="freqz_xrange.patch" --- /usr/src/redhat/SOURCES/octave-2.1.57/scripts/signal/freqz.m Fri Aug 9 13:58:15 2002 +++ freqz.m Tue Aug 10 14:23:28 2004 at @ -160,6 +160,11 @@ h_r = h; w_r = w; else # plot and don't return values + if (strcmp (region, "whole")) + axis ([ 0, Fs ]); + else + axis ([ 0, Fs/2 ]); + endif freqz_plot (w, h); end --- /usr/src/redhat/SOURCES/octave-2.1.57/scripts/signal/freqz_plot.m Mon Nov 24 21:59:41 2003 +++ freqz_plot.m Tue Aug 10 14:27:34 2004 at @ -49,7 +49,8 @@ axis ("labely"); xlabel (""); grid ("on"); - axis ([ w(1), w(n), maxmag-3, maxmag ]); + a = axis; + axis ([ a(1), a(2), maxmag-3, maxmag ]); plot (w, mag, ";Pass band (dB);"); subplot (312); at @ -59,7 +60,8 @@ gset tmargin 0; grid ("on"); if (maxmag - min (mag) > 100) - axis ([ w(1), w(n), maxmag-100, maxmag ]); + a = axis; + axis ([ a(1), a(2), maxmag-100, maxmag ]); else axis ("autoy"); endif at @ -71,7 +73,6 @@ grid ("on"); axis ("autoy"); xlabel ("Frequency"); - axis ([ w(1), w(n) ]); plot (w, phase*360/(2*pi), ";Phase (degrees);"); unwind_protect_cleanup --------------070409040903090200020605--