473,395 Members | 1,972 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Is there any way to even the scale of the axes?

0


I want to visualize the result of some calculations. Here is part of my code:

Expand|Select|Wrap|Line Numbers
  1. fig = plt.figure(figsize=(10, 10))
  2. ax = fig.add_subplot(111, projection='3d')
  3. Lx = np.linspace(0, h_x*(N/2-1)+x_size, int(1.5*N))
  4. Ly = np.linspace(0, h_y*(N/2-1)+y_size, int(1.5*N))
  5. X, Y = np.meshgrid(Lx, Ly)
  6. surf = ax.plot_surface(X, Y, W, cmap=mpl.cm.hsv)
  7. fig.colorbar(surf, shrink=0.75, aspect=15)
  8. plt.show()
After plotting I have images like that. And there is one big problem: the scales of Ox and Oy are not equal. If I put ax.axis('equal') in any place of my code, images will look like that. But they are not very nice. I don't understand, are there some differences between putting this string before or after the plotting, so I have tried both of variants. In matplotlib documentation I have read about changing dimensions of the plot box with the help of ax.axis.('scaled'). But if I try to use this string, I get the empty plot box.

And one more question. In the old version of the program there was such string: ax.plot(x, y, z, linewidth=5, color='k', ls='solid') (x, y, z - coordinates of the tops of the rectangle). So I had black rectangle on my images. And nowadays instead the rectangle I have a lot of small dots. It is very strange, because I don't change anything in the old code.
Jul 3 '19 #1
0 1189

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: David Mertz, Ph.D. | last post by:
A reader of my book (I dunno if the printed or electronic version), emailed me with a common misunderstanding about typing. I thought other readers might benefit from my note to him too. Not that...
36
by: Andrea Griffini | last post by:
I did it. I proposed python as the main language for our next CAD/CAM software because I think that it has all the potential needed for it. I'm not sure yet if the decision will get through, but...
0
by: Madhusudan Singh | last post by:
How does one enable dynamic autoscaling of the axes ? I am using setAxisAutoScale in an application which acquires data, and when the application ends, I do get correctly autoscaled axes, but not...
2
by: monkeyboy | last post by:
Hello, I'm searching for a plotting package that will allow multiple y axes of different scales. For example I'd like to overlay 4 or 5 time series with each series having a separate axis. Does...
2
by: Michael R | last post by:
Hello All. It's great to be in a place where people share their knowledge in a frendly way. It's seem to me unlikely for PivotChart not to have a certain feature. I didn't find it, and...
2
by: cloh | last post by:
Hi guys, I was wondering if there was a way to automatically scale either axis depending on which axis has the larger range. For example, if the primary axis automatically ranges between 10 and...
19
by: Matteo Migliore | last post by:
Hi! I've to scale a vector of numbers of size N to a vector of size M. The trasformation is like a zoom on images but I need on a vector. The second size can be M >= N or M <= N, M 0. The...
1
by: Eric Holbrook | last post by:
I'm using matplotlib to generate (and save) plots of bandwidth data from simulation logs. Since the simulations are of varying lengths, i need a way to scale the axes so that every 100,000 points...
2
by: DaveD170 | last post by:
Hi everybody, I'm newbie in c# and I'm having trouble in creating an excel chart. I have vector of data that my program calculated. It's in the next format: X Y 0.1 100 0.2 90...
0
by: ian dean | last post by:
I have managed to plot a data series on a C# (.NET) chart. However, because the data represents real world coordinates, I need the axes to be isotropic. I.e. the same acale should apply to both x & y...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.