I'm on Python 3.4.3 and cannot upgrade the system.
My issue is that I want do generate 3d wireframe plot using matplotlib
and mpl_toolkits.mplot3d
ax.plot_wireframe(*a,b, rstride=1, cstride=2)
>> SyntaxError: only named arguments may follow *expression
From this question I get, that prior Python 3.5 a starred expression is only allowed as the last item in the exprlist.
Doing ax.plot_wireframe(b,*a, rstride=1, cstride=2)
works, but this - of course - yields in a plot with twisted-up axes.
My question:
Is there a possibilty to swap the axis from the wirefram plot (e.q. ax.plot_wireframe(Z,X,Y)
instead (X,Y,Z)
, or is there another workaround for my problem with the unpacking?
Further details:
a = np.meshgrid(np.arange(ys.shape[0]),xs)
b = ys.T
print(ys.shape)
>>(448, 33)
print(ys.shape[0])
>>488
print(b.shape)
>>(33,448)
print(xs.shape)
>>(33,)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ I was able to circumvent the problem by giving Python what it wanted, namely a named argument. So the line now reads:
ax.plot_wireframe(*a,Z=b)