Example #1
0
    def test_x_y_lables(self):
        fig = plt.figure()
        ax1=fig.add_subplot('211')
        ax1.plot([1],[2])
        ax2=fig.add_subplot('212')
        ax2.plot([3],[4])

        xylabel_subplots(fig,['y1','y2'],['x1','x2'])

        assert_equal(fig.axes[0].get_xlabel(),"x1")
        assert_equal(fig.axes[1].get_xlabel(),"x2")
        assert_equal(fig.axes[0].get_ylabel(),"y1")
        assert_equal(fig.axes[1].get_ylabel(),"y2")
Example #2
0
    def test_x_y_lables(self):
        fig = plt.figure()
        ax1 = fig.add_subplot('211')
        ax1.plot([1], [2])
        ax2 = fig.add_subplot('212')
        ax2.plot([3], [4])

        xylabel_subplots(fig, ['y1', 'y2'], ['x1', 'x2'])

        assert_equal(fig.axes[0].get_xlabel(), "x1")
        assert_equal(fig.axes[1].get_xlabel(), "x2")
        assert_equal(fig.axes[0].get_ylabel(), "y1")
        assert_equal(fig.axes[1].get_ylabel(), "y2")
Example #3
0
    def test_defaults(self):
        fig = plt.figure()
        ax1=fig.add_subplot('211')
        ax1.plot([1],[2])
        ax2=fig.add_subplot('212')
        ax2.plot([3],[4])

        xylabel_subplots(fig)

        assert_equal(fig.axes[0].get_xlabel(),"")
        assert_equal(fig.axes[1].get_xlabel(),"")
        assert_equal(fig.axes[0].get_ylabel(),"")
        assert_equal(fig.axes[1].get_ylabel(),"")
Example #4
0
    def test_defaults(self):
        fig = plt.figure()
        ax1 = fig.add_subplot('211')
        ax1.plot([1], [2])
        ax2 = fig.add_subplot('212')
        ax2.plot([3], [4])

        xylabel_subplots(fig)

        assert_equal(fig.axes[0].get_xlabel(), "")
        assert_equal(fig.axes[1].get_xlabel(), "")
        assert_equal(fig.axes[0].get_ylabel(), "")
        assert_equal(fig.axes[1].get_ylabel(), "")