octave-maintainers
[Top][All Lists]
Advanced

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

addproperty: a `XXX' property already exists in the graphics object


From: Shai Ayal
Subject: addproperty: a `XXX' property already exists in the graphics object
Date: Fri, 11 Dec 2009 12:52:48 +0200

Hi all,

This very descriptive error is raised every time addproperty tries to
add a property that already exists. It's used in the following
plotting scripts:

area.m
colorbar.m
plotyy.m
print.m
stairs.m
private/__add_datasource__.m
private/__bar__.m
private/__contour__.m
private/__errplot__.m
private/__quiver__.m
private/__scatter__.m
private/__stem__.m

with the unfortunate consequence of issuing an error when one of these
scripts is called more than once.
Looking at the matlab documentation, I found no equivalent function to
add properties to objects. While matlab has an addproperty function,
it is used for other things.
In octave this function is used to construct an hggroup object
"on-the-fly", while in matlab all the relevant group objects are
predefined (i.e. the barseries object).

So the question what to do about it? I have several suggestions
(listed in approximate order of complexity to implement)
1. turn the error into a warning
2. in the scripts, check if a propertiy exists before trying to add it
3. Make the added properties belong only to a specific object
instance, so when the instance will be deleted, so will all of it's
added properties
4. remove the addproperty command, and predefine all group objects
(this is matlab compatible)

Comments?

Shai


reply via email to

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