# HG changeset patch # User David Bateman # Date 1272313577 -7200 # Node ID 3eba2cc7cbda587c2f76afca134c90275b22ba6a # Parent 43685a0541c449b4208fd75a45bc42edb93b031f Allow matlab style linestyles in errorbar plots diff -r 43685a0541c4 -r 3eba2cc7cbda scripts/ChangeLog --- 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 * plot/private/__patch__.m: Correct order of calling setdata and diff -r 43685a0541c4 -r 3eba2cc7cbda scripts/plot/private/__errplot__.m --- 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 diff -r 43685a0541c4 -r 3eba2cc7cbda scripts/plot/private/__pltopt__.m --- 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) = [];