Created
November 12, 2014 23:04
-
-
Save keisukefukuda/1447c893f8cffca63318 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib | |
import matplotlib.pyplot as plt | |
import numpy as np | |
fig, ax = plt.subplots() | |
x = np.logspace(-4, 8, 100, base=2.0) | |
y1 = x | |
y2 = x * x | |
ax.plot(x,y1) | |
ax.plot(x,y2) | |
ax.set_xscale('log') | |
ax.set_yscale('log') | |
formatter = matplotlib.ticker.ScalarFormatter(useOffset = False) | |
ax.yaxis.set_major_formatter(formatter) | |
ax.xaxis.set_major_formatter(formatter) | |
ax.xaxis.set_ticks(np.logspace(-4, 8, 13, base=2.0)) | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment