changeset 10575:3eba2cc7cbda

Allow matlab style linestyles in errorbar plots
author David Bateman <dbateman@free.fr>
date Mon, 26 Apr 2010 22:26:17 +0200
parents 43685a0541c4
children 384c514bbae2
files scripts/ChangeLog scripts/plot/private/__errplot__.m scripts/plot/private/__pltopt__.m
diffstat 3 files changed, 12 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/ChangeLog	Mon Apr 26 09:25:32 2010 -0700
+++ b/scripts/ChangeLog	Mon Apr 26 22:26:17 2010 +0200
@@ -6,6 +6,8 @@
 	* plot/private/__errplot__.m: Allow x, box and xy errorbars with
 	different syntax.
 
+	* plot/private/__errplot__.m: Allow matlab style linestyles,
+
 2010-04-24  David Bateman  <dbateman@free.fr>
 
 	* plot/private/__patch__.m: Correct order of calling setdata and
--- a/scripts/plot/private/__errplot__.m	Mon Apr 26 09:25:32 2010 -0700
+++ b/scripts/plot/private/__errplot__.m	Mon Apr 26 22:26:17 2010 +0200
@@ -53,7 +53,7 @@
     elseif (strcmp (fmt.linestyle, "#~>"))
       ifmt = "boxxy";
     else
-      print_usage ();
+      ifmt = "matlab";
     endif
 
     hg = hggroup ("parent", p);
@@ -67,6 +67,13 @@
       hl = __line__ (hg, "color", fmt.color);
     endif
 
+    if (index (ifmt, "matlab"))
+      ifmt = "yerr";
+      if (! strcmp (fmt.linestyle, "none"))
+        set (hl, "linestyle", fmt.linestyle);
+      endif
+    endif
+
     ## FIXME -- note the code below adds the errorbar data directly as
     ## ldata, etc properties of the line objects, as gnuplot can handle
     ## this.  Matlab has the errorbar part of the plot as a special line
--- a/scripts/plot/private/__pltopt__.m	Mon Apr 26 09:25:32 2010 -0700
+++ b/scripts/plot/private/__pltopt__.m	Mon Apr 26 22:26:17 2010 +0200
@@ -154,6 +154,8 @@
     elseif (strncmp (opt, "~", 1) || strncmp (opt, ">", 1) 
             || strncmp (opt, "#", 1))
       n = 1;
+    else
+      n = 0;
     endif
     options.linestyle = opt(1:n);
     opt(1:n) = [];