Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Make axisartist.axislines pseudo-tests real.
The results seem to be acceptable.
  • Loading branch information
QuLogic committed Feb 6, 2018
commit bf25cf61ee57769bd69d9ced00b6fdb0922d127d
45 changes: 0 additions & 45 deletions 45 lib/mpl_toolkits/axisartist/axislines.py
Original file line number Diff line number Diff line change
Expand Up @@ -826,48 +826,3 @@ def _init_axis_artists(self):
self._axislines["yzero"] = yaxis_zero

SubplotZero = maxes.subplot_class_factory(AxesZero)


if 0:
#if __name__ == "__main__":
import matplotlib.pyplot as plt

fig = plt.figure(1, (4,3))

ax = SubplotZero(fig, 1, 1, 1)
fig.add_subplot(ax)

ax.axis["xzero"].set_visible(True)
ax.axis["xzero"].label.set_text("Axis Zero")

for n in ["top", "right"]:
ax.axis[n].set_visible(False)

xx = np.arange(0, 2*np.pi, 0.01)
ax.plot(xx, np.sin(xx))
ax.set_ylabel("Test")
plt.draw()
plt.show()


if __name__ == "__main__":
#if 1:
import matplotlib.pyplot as plt

fig = plt.figure(1, (4,3))

ax = Subplot(fig, 1, 1, 1)
fig.add_subplot(ax)

xx = np.arange(0, 2*np.pi, 0.01)
ax.plot(xx, np.sin(xx))
ax.set_ylabel("Test")

ax.axis["top"].major_ticks.set_tick_out(True) #set_tick_direction("out")
ax.axis["bottom"].major_ticks.set_tick_out(True) #set_tick_direction("out")
#ax.axis["bottom"].set_tick_direction("in")

ax.axis["bottom"].set_label("Tk0")

plt.draw()
plt.show()
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
45 changes: 45 additions & 0 deletions 45 lib/mpl_toolkits/tests/test_axisartist_axislines.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
from __future__ import (absolute_import, division, print_function,
unicode_literals)

import numpy as np
import matplotlib.pyplot as plt
from matplotlib.testing.decorators import image_comparison

from mpl_toolkits.axisartist.axislines import SubplotZero, Subplot


@image_comparison(baseline_images=['SubplotZero'],
extensions=['png'], style='default')
def test_SubplotZero():
fig = plt.figure()

ax = SubplotZero(fig, 1, 1, 1)
fig.add_subplot(ax)

ax.axis["xzero"].set_visible(True)
ax.axis["xzero"].label.set_text("Axis Zero")

for n in ["top", "right"]:
ax.axis[n].set_visible(False)

xx = np.arange(0, 2 * np.pi, 0.01)
ax.plot(xx, np.sin(xx))
ax.set_ylabel("Test")


@image_comparison(baseline_images=['Subplot'],
extensions=['png'], style='default')
def test_Subplot():
fig = plt.figure()

ax = Subplot(fig, 1, 1, 1)
fig.add_subplot(ax)

xx = np.arange(0, 2 * np.pi, 0.01)
ax.plot(xx, np.sin(xx))
ax.set_ylabel("Test")

ax.axis["top"].major_ticks.set_tick_out(True)
ax.axis["bottom"].major_ticks.set_tick_out(True)

ax.axis["bottom"].set_label("Tk0")
Morty Proxy This is a proxified and sanitized view of the page, visit original site.