From help-octave-request at bevo dot che dot wisc dot edu Wed Jan 7 23:16:29 2004 Subject: Re: changing label of a hist ? From: Avraham Rosenberg To: Bart Vandewoestyne cc: help-octave at bevo dot che dot wisc dot edu Date: Thu, 8 Jan 2004 07:15:34 +0200 (IST) On Tue, 6 Jan 2004, Bart Vandewoestyne wrote: > Date: Tue, 06 Jan 2004 00:41:25 +0100 > From: Bart Vandewoestyne > To: help-octave at bevo dot che dot wisc dot edu > Subject: changing label of a hist ? > Resent-Date: Mon, 5 Jan 2004 17:41:26 -0600 > Resent-From: help-octave at bevo dot che dot wisc dot edu > > For simple plotting, it is possible to change the label using for example: > > plot(Xreal, Yreal, ';Real distribution;'); > > Unfortunately, with the 'hist' command, this doesn't work: > > hist(data, bins, ';Generated data;'); > ---> gives errors > > Is it possible to change the label of the 'hist' plotted data, or > would that take me far down delving into the code of hist.m ? > > Regards, > Bart > > -- > Bart Vandewoestyne Bart.Vandewoestyne_at_pandora.be > Naamsesteenweg 328 bus 201 GSM: +32 (0)478 397 697 > B-3001 Heverlee http://osswin.sourceforge.net > ---------------------------------------------------------------------- > "Theory is the general; experiments are the soldiers." (Leonardo da Vinci) > > > > ------------------------------------------------------------- > Octave is freely available under the terms of the GNU GPL. > > Octave's home on the web:http://www.octave.org > How to fund new projects:http://www.octave.org/funding.html > Subscription information:http://www.octave.org/archive.html > ------------------------------------------------------------- > > Hi, As usual, there are several solutions, depending on the amount of time you are wiiling to spend on them. 1-As the histogram plot contains only one graph, there is no reason to insist on putting your information on a legend: title("Real distribution");plot(Xreal, Yreal) would do the trick. 2-If the rather silly "line 1" inside the frame pisses you, you can issue the command "gset nokey", immediately before and "gset key" immediately after. 3-If you are as impulsive and sloppy as me, you can modify the function bar.m, by putting the above mentioned commands before/after the line plot (tmp_xb, tmp_yb); or modify it to be plot (tmp_xb, tmp_yb, ";;"); 4-A slightly better way is to replace this line by: plot (tmp_xb, tmp_yb, ";;"); # originally plot (tmp_xb, tmp_yb); . modified on a rainy afternoon, A.R. 5-The proper thing to do is to copy hist.m and bar.m to the directory where you store your own mfiles, modify mbar.m like above and rename it candybar.m. Then you modify your copy of hist.m to call candibar instead of bar, and rename it to something handy and intuitive, which you will call instead of hist. 6-The alter4native to 5, if you think that your problem is shared by many others is to suggest a permanent change in bar.m by submiting a bug report... Good luck, Avraham PS Suggestions tested on octave-2.1.50, on a debian-3r1 stable release. ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------