Hi there!
I'm not sure if this is the right place to post this question, but I don't know where to get help.
I am playing with matplotlib, I would like to have a 3d figure with logarithmic axis. I was trying some code, like the one below, but I can only see part of the figure at a time, if I try to move it, I can see other parts, but, not complete.
Does anyone have any idea how to make a 3D plot with log axis?
I can see the 3D image if the axis are linear, but as soon as I change to "log", I can only see part of it.
I am trying this in debian wheezy.
Thanks in advance.
/Joc
Code:
import matplotlib as mpl
import numpy as np
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
data=np.array([[1,10,100],[10,1,1],[2,20,82]])
datax=np.array([1,2,3])
datay=np.array([1,2,3])
dataxM,datayM = np.meshgrid(datax, datay)
fig=plt.figure()
ax=Axes3D(fig)
ax.set_xlim3d(datax.min(),datax.max())
ax.set_ylim3d(datay.min(),datay.max())
ax.set_zlim3d(data.min(),data.max())
ax.xaxis.set_scale('log')
ax.yaxis.set_scale('log')
ax.zaxis.set_scale('log')
ax.set_xlabel('x')
ax.set_ylabel('y')
ax.set_zlabel('z')
ax.scatter(dataxM,datayM,data)
plt.show()