-
How do I set a name or label for an axis of an already created histogram? h.axes[0].name = "blah" but that did not work |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
Labels should be settable that way. Names are read only since they are required to be unique in a histogram and changing them later could break that. |
Beta Was this translation helpful? Give feedback.
-
I have a similar use case: I want to clone an axis while modifying its name. Is the suggested way to do this then ax_new = copy.deepcopy(ax_old)
ax_new._ax.metadata["name"] = "newname" I was looking for something like ax_new = type(ax_old)(ax_old, name="new name") or some variant but there is no copy constructor (or I don't know how to reproduce the copy constructor behaviour), and I don't particularly want to have separate constructor calls for the different axis types. |
Beta Was this translation helpful? Give feedback.
Labels should be settable that way. Names are read only since they are required to be unique in a histogram and changing them later could break that.