Mercurial > octave
changeset 24366:8bf013efffa3
Only warn once from gnuplot about "interp" not being supported (bug #52595).
* __gnuplot_draw_axes__.m: New persistent variable do_interp_warning which is
initially true. Check value of do_interp_warning before calculating and
issuing a warning about "interp" not being supported for patches.
author | Rik <rik@octave.org> |
---|---|
date | Wed, 06 Dec 2017 09:05:32 -0800 |
parents | bb993ab9f012 |
children | 1909f2d7a36e |
files | scripts/plot/util/private/__gnuplot_draw_axes__.m |
diffstat | 1 files changed, 8 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/plot/util/private/__gnuplot_draw_axes__.m Wed Dec 06 08:52:46 2017 -0800 +++ b/scripts/plot/util/private/__gnuplot_draw_axes__.m Wed Dec 06 09:05:32 2017 -0800 @@ -733,6 +733,8 @@ endif case "patch" + persistent do_interp_warning = true; + if (strcmp (get (obj.parent, "type"), "hggroup")) obj.displayname = get (obj.parent, "displayname"); endif @@ -839,8 +841,9 @@ ccdat = mapcdata (ccdat(:), obj.cdatamapping, clim, cmap_sz); endif else - if (sum (diff (ccol))) - warning ("\"interp\" not supported, using 1st entry of cdata"); + if (do_interp_warning && sum (diff (ccol))) + warning ('"interp" not supported, using 1st entry of cdata'); + do_interp_warning = false; endif r = mapcdata (ccol, obj.cdatamapping, clim, cmap_sz); color = cmap(r(1),:); @@ -950,8 +953,9 @@ have_cdata(data_idx) = true; endif elseif (strcmp (ec, "interp")) - if (numel (ccol) == 3) - warning ("\"interp\" not supported, using 1st entry of cdata"); + if (do_interp_warning && numel (ccol) == 3) + warning ('"interp" not supported, using 1st entry of cdata'); + do_interp_warning = false; color = ccol(1,:); else if (isscalar (ccol))