I am using log plots as follows in matplotlib, roughly as follows.

```
plt.scatter(x, y)

# use log scales
plt.gca().set_xscale('log')
plt.gca().set_yscale('log')

# set x,y limits
plt.xlim([-1, 3])
plt.ylim([-1, 3])

```

The first problem is that without x,y limits, matplotlib sets scales such that most of the data is not visible -- for some reason, it does not use the minimum and maximum values along the x and y dimensions, so the default plot is extremely misleading.

when I do set the limits manually using plt.xlim, plt.ylim, which I interpret to be -1 to 3 in log10 units (i.e. 1/10th to 3000), I get a plot like the one attached.
![enter image description here](https://i.stack.imgur.com/rBXyU.png)

The axes labels here don't make sense: it goes from 10^1 to 10^3. What's going on here?

I'm including a more detailed example below that shows all these problems with data:

```
import matplotlib
import matplotlib.pyplot as plt
from numpy import *

x = array([58, 0, 20, 2, 2, 0, 12, 17, 16, 6, 257, 0, 0, 0, 0, 1, 0, 13, 25, 9, 13, 94, 0, 0, 2, 42, 83, 0, 0, 157, 27, 1, 80, 0, 0, 0, 0, 2, 0, 41, 0, 4, 0, 10, 1, 4, 63, 6, 0, 31, 3, 5, 0, 61, 2, 0, 0, 0, 17, 52, 46, 15, 67, 20, 0, 0, 20, 39, 0, 31, 0, 0, 0, 0, 116, 0, 0, 0, 11, 39, 0, 17, 0, 59, 1, 0, 0, 2, 7, 0, 66, 14, 1, 19, 0, 101, 104, 228, 0, 31])

y = array([60, 0, 9, 1, 3, 0, 13, 9, 11, 7, 177, 0, 0, 0, 0, 1, 0, 12, 31, 10, 14, 80, 0, 0, 2, 30, 70, 0, 0, 202, 26, 1, 96, 0, 0, 0, 0, 1, 0, 43, 0, 6, 0, 9, 1, 3, 32, 6, 0, 20, 1, 2, 0, 52, 1, 0, 0, 0, 26, 37, 44, 13, 74, 15, 0, 0, 24, 36, 0, 22, 0, 0, 0, 0, 75, 0, 0, 0, 9, 40, 0, 14, 0, 51, 2, 0, 0, 1, 9, 0, 59, 9, 0, 23, 0, 80, 81, 158, 0, 27])

c = 0.01

plt.figure(figsize=(5,3))
s = plt.subplot(1, 3, 1)
plt.scatter(x + c, y + c)
plt.title('Unlogged')
s = plt.subplot(1, 3, 2)
plt.scatter(x + c, y + c)
plt.gca().set_xscale('log', basex=2)
plt.gca().set_yscale('log', basey=2)
plt.title('Logged')
s = plt.subplot(1, 3, 3)
plt.scatter(x + c, y + c)
plt.gca().set_xscale('log', basex=2)
plt.gca().set_yscale('log', basey=2)
plt.xlim([-2, 20])
plt.ylim([-2, 20])
plt.title('Logged with wrong xlim/ylim')
plt.savefig('test.png')

```

This produces the plot below:

![enter image description here](https://i.stack.imgur.com/Ywg4d.png)

In first subplot from left, we have the raw unlogged data. In second, we have logged values default view. In third we have logged values with x/y lims specified. My questions are:

1. why are the default x/y bounds for the scatter plot wrong? the manual says it's supposed to use the min and max values in the data, but this is obviously not the case here. It picked values that hide the vast majority of data.
2. why is it that when I set the bounds myself, in third scatter plot from left, it reverses the order of the labels? Showing 2^8 before 2^5? It's very confusing.
3. finally, how can I get it so that the plots are not squished like that by default using subplots? I wanted these scatter plots to be square.

EDIT: Thanks to Joe and Honk for reply. If I try to adjust subplots like this to be square:

```
plt.figure(figsize=(5,3), dpi=10)
s = plt.subplot(1, 2, 1, adjustable='box', aspect='equal')
plt.scatter(x + c, y + c)
plt.title('Unlogged')
s = plt.subplot(1, 2, 2, adjustable='box', aspect='equal')
plt.scatter(x + c, y + c)
plt.gca().set_xscale('log', basex=2)
plt.gca().set_yscale('log', basey=2)
plt.title('Logged')

```

I get the result below:

![enter image description here](https://i.stack.imgur.com/EAkb5.png)

How can I get so that each plot is square and aligned with each other? It should just be a grid of square, all equal sizes... 

EDIT 2:

To contribute something back, here is how one would take these log 2 plots and make the axes appear with their non-exponent notation:

```
import matplotlib

from matplotlib.ticker import FuncFormatter

def log_2_product(x, pos):
    return "%.2f" %(x)

c = 0.01
plt.figure(figsize=(10,5), dpi=100)
s1 = plt.subplot(1, 2, 1, adjustable='box', aspect='equal')
plt.scatter(x + c, y + c)
plt.title('Unlogged')
plotting.axes_square(s1)
s2 = plt.subplot(1, 2, 2, adjustable='box', aspect='equal')
min_x, max_x = min(x + c), max(x + c)
min_y, max_y = min(y + c), max(y + c)
plotting.axes_square(s2)
plt.xlim([min_x, max_x])
plt.ylim([min_y, max_y])
plt.gca().set_xscale('log', basex=2)
plt.gca().set_yscale('log', basey=2)
plt.scatter(x + c, y + c)
formatter = FuncFormatter(log_2_product)
s2.xaxis.set_major_formatter(formatter)
s2.yaxis.set_major_formatter(formatter)

plt.title('Logged')
plt.savefig('test.png')

```

thanks for your help.