[Changeset]: fix for plot(zeros(1, 0), zeros(1, 0) (Was: [OctDev] Octave-Forge: boxplot)
David Bateman
David.Bateman at motorola.com
Fri Mar 28 04:25:24 CDT 2008
I'd hesitate to make that change since as you say the bug is in Octave
itself.. We shouldn't add additional cruft to work around bugs when we
can fix the issue at the source..
This reason this issue is happening is that "isvector([])" returns false
whereas "isvector(zeros(1,0))" returns true which is the matlab
compatible behavior. Therefore the fix is to promote the test for empty
variable in the base plotting code to be first as in the attached
changeset.
Regards
David
Shaun Jackman wrote:
> boxplot 1.4.1 does not work with octave 3.0.0 for me. If the boxplot
> does not have any outliers, the resulting plot is empty. The
> following fix worked for me. I'd be curious to know if there's a more
> elegant solution.
>
> When the boxplot has no outliers, the variables outliers_x and
> outliers_y become empty 0x1 matrices:
> outliers_x = [](0x1)
> outliers_y = [](0x1)
>
> Evidently the plot function can't deal with this. I could see this
> being a bug in plot though, rather than a bug in boxplot. I would
> expect the plot function to treat a 1x0 empty matrix the same as a
> 0x0 empty matrix.
>
> Cheers,
> Shaun
>
> --- boxplot.m.orig 2008-03-26 14:27:15.000000000 -0700
> +++ boxplot.m 2008-03-26 15:43:19.000000000 -0700
> @@ -182,6 +182,16 @@
> #median_x,median_y
> #cap_x,cap_y
>
> +if min(size(outliers_x)) == 0
> + outliers_x = [];
> + outliers_y = [];
> +endif
> +
> +if min(size(outliers2_x)) == 0
> + outliers2_x = [];
> + outliers2_y = [];
> +endif
> +
> ## Do the plot
> if vertical
> plot (quartile_x, quartile_y, "b;;",
>
>
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
> _______________________________________________
> Octave-dev mailing list
> Octave-dev at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/octave-dev
>
>
--
David Bateman David.Bateman at motorola.com
Motorola Labs - Paris +33 1 69 35 48 04 (Ph)
Parc Les Algorithmes, Commune de St Aubin +33 6 72 01 06 33 (Mob)
91193 Gif-Sur-Yvette FRANCE +33 1 69 35 77 01 (Fax)
The information contained in this communication has been classified as:
[x] General Business Information
[ ] Motorola Internal Use Only
[ ] Motorola Confidential Proprietary
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch7855
Url: https://www.cae.wisc.edu/pipermail/bug-octave/attachments/20080328/f96ee27d/attachment.ksh
More information about the Bug-octave
mailing list