-
-
Notifications
You must be signed in to change notification settings - Fork 231
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
matplotlibs polar plot -> pgfplots polaraxis #11
Comments
+1
|
import matplotlib.pyplot as plt
plt.polar(1,1)
ax = plt.gca()
print(ax.spines) Returns:
While import matplotlib.pyplot as plt
plt.plot(1,1)
ax = plt.gca()
print(ax.spines) Returns:
You hack it a bit and create: ax.spines["bottom"] = ax.spines["inner"] And get (for the polar plot):
|
A quick and dirty workaround: import matplotlib.pyplot
import numpy
import tikzplotlib
ax = matplotlib.pyplot.subplot(111) # no projection='polar' here
x_grid = numpy.linspace(0, 360, 100, endpoint=False)
ax.plot(x_grid, numpy.random.random(100))
tikzplotlib.save('example.tex',
standalone=True,
extra_axis_parameters=[r'xticklabel shift=5pt',
r'xticklabel=$\pgfmathprintnumber{\tick}\si{\degree}$'])
with open('example.tex', 'r') as file:
filedata = file.read()
filedata = filedata.replace(r'\begin{document}', r'\usepackage{siunitx} \usepgfplotslibrary{polar} \begin{document}')
filedata = filedata.replace('{axis}', '{polaraxis}')
with open('example.tex', 'w') as file:
file.write(filedata) Note that the plot is not polar in |
+1 , my graph is :
generates the following error:
|
A matlab/matplotlib polar plot should be converted into a polaraxis object of pgfplots
The text was updated successfully, but these errors were encountered: