Open maclariz opened 1 year ago
axh.text(Vector3d.from_polar(1,1),letter[7], size=20)
What is letter[7]
here? I think you have to specify it as a keyword argument s=letter[7]
.
I must say not being able to pass cartesian (x, y) to StereographicPlot.text()
has annoyed me sometimes. One solution is to "bypass" our custom text()
method (docs) when x
and y
are among the keyword arguments, and use Matplotlib directly to place a piece of text. I think this is clean and straight forward.
Okay, your workaround works, you do not normally need to tell "text" that a text string is the text. i.e. this code worked in all other cells that weren't stereographic... It not being cartesian and not being allowed to specify transform=axh.transAxes is annoying but easy to work around
you do not normally need to tell "text" that a text string is the text. i.e. this code worked in all other cells that weren't stereographic...
You are right, with the StereographicPlot
we have overwritten Axes.plot()
, scatter()
and text()
to allow passing a Vector3d
or azimuthal and polar angles (see e.g. the scatter() docs). To separate between these two types of input, our overridden methods require all other arguments passed on to Matplotlib to be keyword arguments. This is stated in the docstrings. I don't see a way to have this functionality and still allow a string to be the second argument (not keyword argument) passed.
It's fine. Just confusing first time.
I suggest to leave this open until we've either implemented my suggestion in https://github.com/pyxem/orix/issues/422#issuecomment-1410577422 or have decided it's not a good idea.
Thank you for opening this issue, @maclariz.
I will also comment that you did not touch ax.set_title, so this can still be used. For what I was doing (adding letters a)-h) for a multipart figure), this was fine, as I only needed something in top left, so could use:
ax.set_title(letter[i], loc='left')
Just realized we haven't overwritten Figure.text()
. We can use this method to add text as normal with Matplotlib.
I cannot seem to add text within a stereographic plot. Here is the code:
The errors said the position had to be defined as a Vector3d. I did this, and still it fails: