Gnuplot problem

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Gnuplot problem

Dave Jansing
I am very excited about using octave for future research!  So far, I have
been very impressed with what I have seen (I have only downloaded and used
it today).  However, I am having a small problem with the plotting function
and am hoping that someone can help.

In calling up this simple program:

-------------------------------------------------------------------------------
% M-file for Example 1-15
%
t=-10:.005:10;
x=stp_fn(t-2); % Generate step starting at t=2
y=impls_fn(t+2.5, 0.05); % Generate unit impulse at t=-3.5
z=2*rmp_fn(4-t); % Generate backwars ramp starting at t=4
subplot(3,1,1),plot(t,x),axis([-10 10 0 1.5]),xlabel('t'),ylabel('u(t-2)')
subplot(3,1,2),plot(t,y),axis([-10 10 0 25]),xlabel('t'),ylabel('delta(t+3)')
subplot(3,1,3),plot(t,z),xlabel('t'),ylabel('2r(4-t)')
-------------------------------------------------------------------------------

It will generate the plots with no problem, however the labels on the X and Y
axis are missing.  Have I missed something in the installation process?

Here is some information that may be of use:

System:  Linux (Slackware 3.1)
CPU:     AMD 5x86
Octave:  2.0.11 (from BINARIES directory at the ftp site)
Gnuplot: 3.6 beta

Finally, has anyone tried to include the "text()" function from M**lab in
Octave?

Thanks!

--
                               Dr. David Jansing
       University of Louisville - Department of Electrical Engineering
http://archangel.spd.louisville.edu/~dave    [hidden email]
------------------------------------------------------------------------------


Reply | Threaded
Open this post in threaded view
|

Gnuplot problem

John W. Eaton-6
On 16-Mar-1998, Dave Jansing <[hidden email]> wrote:

| I am very excited about using octave for future research!  So far, I have
| been very impressed with what I have seen (I have only downloaded and used
| it today).  However, I am having a small problem with the plotting function
| and am hoping that someone can help.
|
| In calling up this simple program:
|
| -------------------------------------------------------------------------------
| % M-file for Example 1-15
| %
| t=-10:.005:10;
| x=stp_fn(t-2); % Generate step starting at t=2
| y=impls_fn(t+2.5, 0.05); % Generate unit impulse at t=-3.5
| z=2*rmp_fn(4-t); % Generate backwars ramp starting at t=4
| subplot(3,1,1),plot(t,x),axis([-10 10 0 1.5]),xlabel('t'),ylabel('u(t-2)')
| subplot(3,1,2),plot(t,y),axis([-10 10 0 25]),xlabel('t'),ylabel('delta(t+3)')
| subplot(3,1,3),plot(t,z),xlabel('t'),ylabel('2r(4-t)')
| -------------------------------------------------------------------------------
|
| It will generate the plots with no problem, however the labels on the X and Y
| axis are missing.  Have I missed something in the installation process?

One possible solution is to set the variable automatic_replot to a
nonzero value.  Unfortunately, this will make your plot do some weird
dance before it is finally displayed.  To avoid that, you could just
call replot once after each call to ylabel.

Another solution is to call xlabel and ylabel before the plot command.

In any case, because of the way gnuplot places multiple plots with
labels on the X11 window, I don't think you'll be too happy with the
result.  But I think this is a bug in gnuplot, not Octave.

jwe