Repository navigation
|
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 |
Answered by
henryiii
Apr 28, 2021
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. |
5 replies
Answer selected by
nsmith-
|
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. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.