help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: xlabel not visible on plot


From: Ben Abbott
Subject: Re: xlabel not visible on plot
Date: Mon, 29 Jun 2009 16:03:55 -0400

 On Monday, June 29, 2009, at 12:01PM, "Lukas Reichlin" <address@hidden> wrote:
>Dear Octave Community,
>
>How can I make xlabel('Frequency [rad/s]') visible on a plot? The plot  
>window seems to be too small. I'm using Octave 3.2.0 on Mac OS X  
>10.5.7 with GnuPlot 4.2.5 and AquaTerm 1.0.1. Thanks for any help.
>
>Regards,
>Lukas
>
>
>EXAMPLE M-FILE:
>
>
>% Heat Exchanger
>
>
>% Tabula Rasa
>clear all;
>close all;
>clc;
>
>
>% Physical Parameters
>m_star_1 = 0.5;  % kg/s
>m_star_2 = 0.2;  % kg/s
>V_1 = 0.01;      % m^3
>V_2 = 0.02;      % m^3
>
>rho = 1000;      % kg/m^3
>c = 4200;        % J/(kg K)
>Ar = 2;          % m^2
>k = 2000;        % W/(m^2 K)
>
>
>% Control-Oriented Parameters
>tau_1 = rho * V_1 * c / ( m_star_1 * c  +  k * Ar );
>tau_2 = rho * V_2 * c / ( m_star_2 * c  +  k * Ar );
>
>sigma_1 = k * Ar / ( m_star_1 * c  +  k * Ar );
>sigma_2 = k * Ar / ( m_star_2 * c  +  k * Ar );
>
>beta_1 = m_star_1 * c / ( m_star_1 * c  +  k * Ar );
>beta_2 = m_star_2 * c / ( m_star_2 * c  +  k * Ar );
>
>
>% System Matrices
>A = [      -1/tau_1    sigma_1/tau_1 ;
>       sigma_2/tau_2         -1/tau_2 ];
>
>B = [ beta_1/tau_1               0 ;
>                  0    beta_2/tau_2 ];
>
>C = [ 1    0 ;
>       0    1 ];
>
>D = [ 0    0 ;
>       0    0 ];
>
>
>% State Space Form
>sys = ss(A,B,C,D);
>
>
>% Stability
>eigw = eig(A)
>
>
>% Controllability
>co = ctrb(A,B);
>r_co = rank(co)
>
>
>% Observability
>ob = obsv(A,C);
>r_ob = rank(ob)
>
>
>% Singular Value Plot
>w = logspace(-3, 1, 1000);   % rad/s
>
>for k = 1 : size(w, 2)
>       
>       % Frequency Response Matrix
>       P = C * inv(i * w(k) * eye(size(A))  -  A) * B  +  D;
>       
>       % Singular Value Decomposition
>       sigma = svd(P);
>       sigma_max(k) = max(sigma);
>       sigma_min(k) = min(sigma);
>end
>
>figure(1)
>semilogx(w, 20*log10(sigma_max), w, 20*log10(sigma_min))
>xlabel('Frequency [rad/s]')
>ylabel('Singular Values [dB]')
>grid on
>

Octave uses gnuplot to render its figures. Gnuplot's output looks a bit 
different depending upon the "terminal" you use. I expect you are currently 
using Aquaterm.

You might try using x11 (x11 should be in your utilities folder) ...

close all
setenv ("GNUTERM", "x11")
plot (1:10)
xlabel ("my xlabel")

or (if you have it installed) try wxt

close all
setenv ("GNUTERM", "wxt")
plot (1:10)
xlabel ("my xlabel")

The one sure way to get what you want is to change the default position of the 
plot box.

close all
set (0, "defaultaxesposition", [0.13, 0.13, 0.775, 0.795])
plot (1:10)
xlabel ("my xlabel")

Ben



reply via email to

[Prev in Thread] Current Thread [Next in Thread]