-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Fabio Zanini
committed
Mar 2, 2015
1 parent
ee086de
commit 76840ea
Showing
9 changed files
with
334 additions
and
3 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import numpy as np | ||
import matplotlib.pyplot as plt | ||
|
||
# make up some data in the interval ]0, 1[ | ||
y = np.random.normal(loc=0.5, scale=0.4, size=1000) | ||
y = y[(y > 0) & (y < 1)] | ||
y.sort() | ||
x = np.arange(len(y)) | ||
|
||
# plot with various axes scales | ||
plt.figure(1) | ||
|
||
# linear | ||
plt.subplot(221) | ||
plt.plot(x, y) | ||
plt.yscale('linear') | ||
plt.title('linear') | ||
plt.grid(True) | ||
|
||
|
||
# log | ||
plt.subplot(222) | ||
plt.plot(x, y) | ||
plt.yscale('log') | ||
plt.title('log') | ||
plt.grid(True) | ||
|
||
|
||
# symmetric log | ||
plt.subplot(223) | ||
plt.plot(x, y - y.mean()) | ||
plt.yscale('symlog', linthreshy=0.05) | ||
plt.title('symlog') | ||
plt.grid(True) | ||
|
||
# logit | ||
plt.subplot(223) | ||
plt.plot(x, y) | ||
plt.yscale('logit') | ||
plt.title('logit') | ||
plt.grid(True) | ||
|
||
plt.show() |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Logit Scale | ||
----------- | ||
Added support for the 'logit' axis scale, a nonlinear transformation | ||
`x -> log10(x / (1-x))` for data between 0 and 1 excluded. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
""" | ||
Illustrate the scale transformations applied to axes, e.g. log, symlog, logit. | ||
""" | ||
import numpy as np | ||
import matplotlib.pyplot as plt | ||
|
||
# make up some data in the interval ]0, 1[ | ||
y = np.random.normal(loc=0.5, scale=0.4, size=1000) | ||
y = y[(y > 0) & (y < 1)] | ||
y.sort() | ||
x = np.arange(len(y)) | ||
|
||
# plot with various axes scales | ||
fig, axs = plt.subplots(2, 2) | ||
|
||
# linear | ||
ax = axs[0, 0] | ||
ax.plot(x, y) | ||
ax.set_yscale('linear') | ||
ax.set_title('linear') | ||
ax.grid(True) | ||
|
||
|
||
# log | ||
ax = axs[0, 1] | ||
ax.plot(x, y) | ||
ax.set_yscale('log') | ||
ax.set_title('log') | ||
ax.grid(True) | ||
|
||
|
||
# symmetric log | ||
ax = axs[1, 0] | ||
ax.plot(x, y - y.mean()) | ||
ax.set_yscale('symlog', linthreshy=0.05) | ||
ax.set_title('symlog') | ||
ax.grid(True) | ||
|
||
# logit | ||
ax = axs[1, 1] | ||
ax.plot(x, y) | ||
ax.set_yscale('logit') | ||
ax.set_title('logit') | ||
ax.grid(True) | ||
|
||
|
||
plt.show() |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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