octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #37290] gnuplot / demo plotyy followed by somb


From: Dan Sebald
Subject: [Octave-bug-tracker] [bug #37290] gnuplot / demo plotyy followed by sombrero errors out
Date: Mon, 20 May 2013 05:10:30 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:18.0) Gecko/20100101 Firefox/18.0 SeaMonkey/2.15

Follow-up Comment #35, bug #37290 (project octave):

Ben,

That error is what happens after the patch is applied and a "reset (gcf)" is
input.  The way the code is set up, read-only variables are in the factory
defaults:


property_list::pval_map_type
axes::properties::factory_defaults (void)
{
  property_list::pval_map_type m = base_properties::factory_defaults ();

  m["position"] = default_axes_position ();
  m["box"] = "on";
{snip}
  m["tightinset"] = Matrix (1, 4, 0.0);
{snip}
  m["autopos_tag"] = "none";

  return m;
}


but they are not in this if-else "set" structure:


void
axes::properties::set (const caseless_str& pname_arg, const octave_value&
val)
{
  const std::set<std::string>& pnames = all_property_names ();

  caseless_str pname = validate_property_name ("get", go_name, pnames,
pname_arg);

  if (error_state)
    return;

  if (pname.compare ("position"))
    set_position (val);
  else if (pname.compare ("box"))
    set_box (val);
  else if (pname.compare ("colororder"))
{snip: no 'tightinset' in this list}
  else if (pname.compare ("autopos_tag"))
    set_autopos_tag (val);
  else
    base_properties::set (pname, val);
}


The point is that there is no way of knowing which are read-only variables
with this construct, so if one restores the factory settings the only thing is
to know beforehand which read-only variable names to condition out of the
reset.  Not difficult to do, but again it feels like real patchwork for only
marginal gain.

If you want to replicate the issue, try


>> get (gca, 'tightinset')
ans =

   0   0   0   0

>> set (gca, 'tightinset', [0 0 0 0])
error: set: unknown property "tightinset"


Regarding the 'set(gca, "defaultlinewidth", 2.3)', you are correct.  Maybe I
was confused by the axes "linewidth", but as written the "width" is checked in
the "line" object.  I will look at that again.  Thanks.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?37290>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]