forked from matplotlib/matplotlib
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request matplotlib#1 from CSC-D01-Winter-2015/Issue-#3610
Issue matplotlib#3610
- Loading branch information
Showing
9 changed files
with
95 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import matplotlib as mpl | ||
from mpl_toolkits.mplot3d import Axes3D | ||
import matplotlib.pyplot as plt | ||
print(mpl.__file__) | ||
fig = plt.figure() | ||
ax = fig.gca(projection='3d') | ||
ax.set_xlabel('X LABEL', labelpad=-.5) | ||
ax.set_ylabel('Y LABEL') | ||
ax.yaxis._axinfo['label']['space_factor'] = 3 | ||
ax.set_zlabel('Z LABEL') | ||
ax.zaxis.labelpad = -2 | ||
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
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
Binary file added
BIN
+6.37 KB
lib/mpl_toolkits/tests/baseline_images/test_mplot3d_axes/3Dlabelpad.pdf
Binary file not shown.
Binary file added
BIN
+44.8 KB
lib/mpl_toolkits/tests/baseline_images/test_mplot3d_axes/3Dlabelpad.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+6.43 KB
lib/mpl_toolkits/tests/baseline_images/test_mplot3d_axes/3Dlabelpad_default.pdf
Binary file not shown.
Binary file added
BIN
+51.1 KB
lib/mpl_toolkits/tests/baseline_images/test_mplot3d_axes/3Dlabelpad_default.png
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
from mpl_toolkits.mplot3d import Axes3D, axes3d | ||
import matplotlib.pyplot as plt | ||
from nose.tools import assert_equal, assert_raises, assert_false, assert_true | ||
|
||
from matplotlib.testing.decorators import cleanup, image_comparison | ||
|
||
@image_comparison(baseline_images=['3Dlabelpad_default'], remove_text=True, | ||
extensions=['png', 'pdf']) | ||
def test_axes_labelpad_default(): | ||
fig = plt.figure() | ||
ax = fig.gca(projection='3d') | ||
z = [0,1] | ||
x = [0,1] | ||
y = [0,1] | ||
ax.plot(x, y, z) | ||
ax.set_xlabel('X LABEL') | ||
ax.set_ylabel('Y LABEL') | ||
ax.set_zlabel('Z LABEL') | ||
plt.draw() | ||
assert_equal(ax.xaxis.labelpad, ax.xaxis.DEFAULTLABELPAD) | ||
assert_equal(ax.yaxis.labelpad, ax.yaxis.DEFAULTLABELPAD) | ||
assert_equal(ax.zaxis.labelpad, ax.zaxis.DEFAULTLABELPAD) | ||
|
||
@image_comparison(baseline_images=['3Dlabelpad'], remove_text=True, | ||
extensions=['png', 'pdf']) | ||
def test_axes_labelpad_image(): | ||
fig = plt.figure() | ||
ax = fig.gca(projection='3d') | ||
ax.set_xlabel('X LABEL', labelpad=-.5) | ||
ax.set_ylabel('Y LABEL') | ||
ax.yaxis._axinfo['label']['space_factor'] = 3 | ||
ax.set_zlabel('Z LABEL') | ||
ax.zaxis.labelpad = -2 | ||
|
||
@cleanup | ||
def test_axes_labelpad(): | ||
fig = plt.figure() | ||
ax = fig.gca(projection='3d') | ||
z = [0,1] | ||
x = [0,1] | ||
y = [0,1] | ||
ax.plot(x, y, z) | ||
ax.set_xlabel('X LABEL', labelpad=3) | ||
plt.draw() | ||
assert_equal(ax.xaxis.labelpad, 3) | ||
|
||
@cleanup | ||
def test_axes_labelpad_oldmethod(): | ||
fig = plt.figure() | ||
ax = fig.gca(projection='3d') | ||
z = [0,1] | ||
x = [0,1] | ||
y = [0,1] | ||
ax.plot(x, y, z) | ||
ax.set_zlabel('Z LABEL') | ||
ax.zaxis._axinfo['label']['space_factor'] = 3 | ||
plt.draw() | ||
assert_equal(ax.zaxis.labelpad, 3) | ||
|
||
|
||
if __name__ == '__main__': | ||
import nose | ||
nose.runmodule(argv=['-s', '--with-doctest'], exit=False) |