Skip to content

Adding a legend causes AttributeError #564

New issue

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

Open
Daniel003203 opened this issue Dec 21, 2022 · 2 comments
Open

Adding a legend causes AttributeError #564

Daniel003203 opened this issue Dec 21, 2022 · 2 comments

Comments

@Daniel003203
Copy link

import matplotlib.pyplot as plt
import numpy as np

plt.style.use("ggplot")

t = np.arange(0.0, 2.0, 0.1)
s = np.sin(2 * np.pi * t)
s2 = np.cos(2 * np.pi * t)
plt.plot(t, s, "o-", lw=4.1, label='test')
plt.plot(t, s2, "o-", lw=4.1, label='test2')
plt.xlabel("time (s)")
plt.ylabel("Voltage (mV)")
plt.title("Simple plot $\frac{\alpha}{2}$")
plt.legend()
plt.grid(True)

import tikzplotlib
tikzplotlib.save("test.tex")

@eqnmapper
Copy link

This is addressed in pull request #565. Until being merged, you can change the attribute according to the request in your local installation of tikzplotlib.

@Liu-Yinlong
Copy link

AttributeError: 'Legend' object has no attribute '_ncol'. Did you mean: '_ncols'?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants