LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-07-2014, 08:18 AM   #1
orcaja
Member
 
Registered: Aug 2008
Posts: 94

Rep: Reputation: 1
Matplotlib, 3D logaxis, incomplete figure


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()
Attached Thumbnails
Click image for larger version

Name:	python.png
Views:	15
Size:	25.0 KB
ID:	14901  
 
  


Reply

Tags
graphics, plot, python



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Unit Circle - Matplotlib Gavin Harper Programming 1 04-18-2011 02:46 PM
matplotlib--graphing against time pgb205 Programming 1 06-01-2009 01:35 PM
matplotlib not displaying graphics in opensuse 10.2 djstrozzi SUSE / openSUSE 0 02-03-2007 11:50 AM
matplotlib rpm OldAl SUSE / openSUSE 2 11-19-2006 01:23 AM
Matplotlib: Need help fixing weird include error Neruocomp Linux - Software 1 09-15-2005 06:56 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:52 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration