Reputation: 1708
Consider following code (adapted from here):
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
import tikzplotlib
r=np.linspace(0,1,11)
theta=np.linspace(0,2*np.pi,11)
R,Theta=np.meshgrid(r,theta)
X,Y=R*np.cos(Theta),R*np.sin(Theta)
Z=R*np.sin(Theta)*np.cos(Theta)
fig=plt.figure(1)
plt.clf()
ax=fig.add_subplot(projection='3d')
ax.plot_surface(X,Y,Z,rstride=1,cstride=1,cmap=cm.inferno,linewidth=0)
ax.set_xlabel('test here')
plt.show()
tikzplotlib.save("testfigure.tex")
which gives following figure :
When I import the file testfigure.tex
in a LaTeX file, after having replaced
\begin{axis}[
hide x axis,
hide y axis,
by
\begin{axis}[
width=10cm,
width=10cm,
I obtain this result :
What can I do, in order to have the axis as in the Python figure? Or is this simply not possible with tikzplotlib
?
Upvotes: 0
Views: 1179
Reputation: 1300
Github Readme of tikzplotlib states 3D plots are not supported (2021).
Upvotes: 1