We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I also asked this on stackoverflow (https://stackoverflow.com/questions/79303139/maptloblib-adjust-text-and-errorbar). Due to a comment I tried again and found that there is a problem occuring only when matplotlib styles are used.
See following example:
import matplotlib as mpl import matplotlib.pyplot as plt import numpy as np import scienceplots # type: ignore from adjustText import adjust_text plt.style.use(["science", "notebook"]) fig, ax = plt.subplots() x = np.linspace(0, 1, 50) * np.pi y = np.sin(x) errbar_container = ax.errorbar(x, y, xerr=0.25, yerr=0.05) texts = [] for idx in range(0, len(x),2): texts.append( ax.annotate( idx, xy=(x[idx], y[idx]), size="large", zorder=100, ) ) adjust_text( texts, x=x, y=y, expand=(2, 2), objects=[ *[mpl.transforms.Bbox(seg) for seg in errbar_container.lines[-1][0].get_segments()], *[mpl.transforms.Bbox(seg) for seg in errbar_container.lines[-1][1].get_segments()], ], arrowprops=dict(arrowstyle="->", color="red"), ) plt.show()
which produces following plot:
Note how 0, 2 and 4 plotted on the line.
0
2
4
Moreover it seems that option like autoalign, only_move are ignored.
autoalign
only_move
Without plt.style.use(["science", "notebook"]) everything looks fine.
plt.style.use(["science", "notebook"])
So what am I missing here?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I also asked this on stackoverflow (https://stackoverflow.com/questions/79303139/maptloblib-adjust-text-and-errorbar).
Due to a comment I tried again and found that there is a problem occuring only when matplotlib styles are used.
See following example:
which produces following plot:
Note how
0
,2
and4
plotted on the line.Moreover it seems that option like
autoalign
,only_move
are ignored.Without
plt.style.use(["science", "notebook"])
everything looks fine.So what am I missing here?
The text was updated successfully, but these errors were encountered: