From: <par...@us...> - 2011-12-11 16:49:45
|
Revision: 9366 http://octave.svn.sourceforge.net/octave/?rev=9366&view=rev Author: paramaniac Date: 2011-12-11 16:49:39 +0000 (Sun, 11 Dec 2011) Log Message: ----------- control: rework axis limits of plotting (2) Modified Paths: -------------- trunk/octave-forge/main/control/inst/__plot_margin__.m trunk/octave-forge/main/control/inst/bode.m Modified: trunk/octave-forge/main/control/inst/__plot_margin__.m =================================================================== --- trunk/octave-forge/main/control/inst/__plot_margin__.m 2011-12-11 15:37:14 UTC (rev 9365) +++ trunk/octave-forge/main/control/inst/__plot_margin__.m 2011-12-11 16:49:39 UTC (rev 9366) @@ -38,6 +38,11 @@ function axvec = __plot_margin__ (axdata) + if (any (isinf (axdata))) + axvec = "tight"; + return; + endif + ## compute axis limits minv = axdata(1); maxv = axdata(2); @@ -45,6 +50,7 @@ midv = (minv + maxv)/2; # midpoint of the plot axmid = [midv, midv]; axdel = [-0.1, 0.1]; # default plot width (if less than 2-d data) + if (delv == 0) if (midv != 0) axdel = [-0.1*midv, 0.1*midv]; @@ -56,6 +62,7 @@ axdel = 1.1*[-delv,delv]; endif endif + axvec = axmid + axdel; endfunction Modified: trunk/octave-forge/main/control/inst/bode.m =================================================================== --- trunk/octave-forge/main/control/inst/bode.m 2011-12-11 15:37:14 UTC (rev 9365) +++ trunk/octave-forge/main/control/inst/bode.m 2011-12-11 16:49:39 UTC (rev 9366) @@ -73,7 +73,7 @@ subplot (2, 1, 1) semilogx (w, mag_db) axis ("tight") - ylim (__plot_margin__ (ylim)); + %ylim (__plot_margin__ (ylim)); grid ("on") title (["Bode Diagram of ", inputname(1)]) ylabel ("Magnitude [dB]") @@ -81,7 +81,7 @@ subplot (2, 1, 2) semilogx (w, pha) axis ("tight") - ylim (__plot_margin__ (ylim)); + %ylim (__plot_margin__ (ylim)); grid ("on") xlabel (xl_str) ylabel ("Phase [deg]") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |