예제 #1
0
    def test_prop_dict_ylabel(self):
        fig = plot_single_material_vs_depth((self.a, self.b),
                                            self.xlabels,
                                            prop_dict={'ylabel': 'hello'})
        ax1 = fig.get_axes()[0]

        assert_equal(ax1.get_ylabel(), 'hello')
예제 #2
0
    def test_prop_dict_ylabel(self):
        fig = plot_single_material_vs_depth((self.a, self.b),
                                            self.xlabels,
                                            prop_dict={'ylabel': 'hello'})
        ax1 = fig.get_axes()[0]

        assert_equal(ax1.get_ylabel(), 'hello')
예제 #3
0
    def test_defaults(self):
        fig = plot_single_material_vs_depth((self.a, self.b), self.xlabels)

        assert_equal(len(fig.get_axes()), 2)
        ax1 = fig.get_axes()[0]
        line1= ax1.get_lines()[0]

        ax2 = fig.get_axes()[1]
        line2 = ax2.get_lines()[0]

        assert_allclose(line1.get_xydata()[0],
                     np.array([ 1., 0.]))
        assert_allclose(line1.get_xydata()[-1],
                     np.array([ 2., 1]))

        assert_allclose(line2.get_xydata()[0],
                     np.array([ 2., 0.]))
        assert_allclose(line2.get_xydata()[-1],
                     np.array([ 3., 1]))

        assert_equal(ax1.get_xlabel(), 'a')
        assert_equal(ax2.get_xlabel(), 'b')

        assert_equal(ax1.get_ylabel(), 'Depth, z')
        assert_equal(ax2.get_ylabel(), '')
예제 #4
0
    def test_defaults(self):
        fig = plot_single_material_vs_depth((self.a, self.b), self.xlabels)

        assert_equal(len(fig.get_axes()), 2)
        ax1 = fig.get_axes()[0]
        line1= ax1.get_lines()[0]

        ax2 = fig.get_axes()[1]
        line2 = ax2.get_lines()[0]

        assert_allclose(line1.get_xydata()[0],
                     np.array([ 1., 0.]))
        assert_allclose(line1.get_xydata()[-1],
                     np.array([ 2., 1]))

        assert_allclose(line2.get_xydata()[0],
                     np.array([ 2., 0.]))
        assert_allclose(line2.get_xydata()[-1],
                     np.array([ 3., 1]))

        assert_equal(ax1.get_xlabel(), 'a')
        assert_equal(ax2.get_xlabel(), 'b')

        assert_equal(ax1.get_ylabel(), 'Depth, z')
        assert_equal(ax2.get_ylabel(), '')
예제 #5
0
 def test_propdict_fig_prop_figsize(self):
     fig = plot_single_material_vs_depth(
         (self.a, self.b),
         self.xlabels,
         prop_dict={'fig_prop': {
             'figsize': (8, 9)
         }})
     assert_allclose(fig.get_size_inches(), (8, 9))
예제 #6
0
    def test_prop_dict_styles(self):
        fig = plot_single_material_vs_depth((self.a, self.b), self.xlabels,

                           prop_dict={'styles':[{'markersize': 12,
                                                 'marker': '^'}]})
        ax1 = fig.get_axes()[0]
        line1= ax1.get_lines()[0]

        ax2 = fig.get_axes()[1]
        line2 = ax2.get_lines()[0]

        assert_equal(line1.get_marker(),'^')
        assert_equal(line1.get_markersize(),12)
        assert_equal(line2.get_marker(),'^')
        assert_equal(line2.get_markersize(),12)
예제 #7
0
    def test_prop_dict_styles(self):
        fig = plot_single_material_vs_depth((self.a, self.b), self.xlabels,

                           prop_dict={'styles':[{'markersize': 12,
                                                 'marker': '^'}]})
        ax1 = fig.get_axes()[0]
        line1= ax1.get_lines()[0]

        ax2 = fig.get_axes()[1]
        line2 = ax2.get_lines()[0]

        assert_equal(line1.get_marker(),'^')
        assert_equal(line1.get_markersize(),12)
        assert_equal(line2.get_marker(),'^')
        assert_equal(line2.get_markersize(),12)
예제 #8
0
    def test_H(self):

        fig = plot_single_material_vs_depth((self.a, self.b),
                                            self.xlabels,
                                            H=2)

        ax1 = fig.get_axes()[0]
        line1 = ax1.get_lines()[0]

        ax2 = fig.get_axes()[1]
        line2 = ax2.get_lines()[0]

        assert_allclose(line1.get_xydata()[0], np.array([1., 0.]))
        assert_allclose(line1.get_xydata()[-1], np.array([2., 2]))

        assert_allclose(line2.get_xydata()[0], np.array([2., 0.]))
        assert_allclose(line2.get_xydata()[-1], np.array([3., 2]))
예제 #9
0
    def test_H(self):

        fig = plot_single_material_vs_depth((self.a, self.b), self.xlabels,
                                            H=2)

        ax1 = fig.get_axes()[0]
        line1= ax1.get_lines()[0]

        ax2 = fig.get_axes()[1]
        line2 = ax2.get_lines()[0]

        assert_allclose(line1.get_xydata()[0],
                     np.array([ 1., 0.]))
        assert_allclose(line1.get_xydata()[-1],
                     np.array([ 2., 2]))

        assert_allclose(line2.get_xydata()[0],
                     np.array([ 2., 0.]))
        assert_allclose(line2.get_xydata()[-1],
                     np.array([ 3., 2]))
예제 #10
0
    def test_RLzero(self):

        fig = plot_single_material_vs_depth((self.a, self.b),
                                            self.xlabels,
                                            H=2,
                                            RLzero=1)

        ax1 = fig.get_axes()[0]
        line1 = ax1.get_lines()[0]

        ax2 = fig.get_axes()[1]
        line2 = ax2.get_lines()[0]

        assert_allclose(line1.get_xydata()[0], np.array([1., 1]))
        assert_allclose(line1.get_xydata()[-1], np.array([2., -1]))

        assert_allclose(line2.get_xydata()[0], np.array([2., 1]))
        assert_allclose(line2.get_xydata()[-1], np.array([3., -1]))

        assert_equal(ax1.get_ylabel(), 'RL')
예제 #11
0
    def test_RLzero(self):

        fig = plot_single_material_vs_depth((self.a, self.b), self.xlabels,
                                            H=2, RLzero=1)

        ax1 = fig.get_axes()[0]
        line1= ax1.get_lines()[0]

        ax2 = fig.get_axes()[1]
        line2 = ax2.get_lines()[0]

        assert_allclose(line1.get_xydata()[0],
                     np.array([ 1., 1]))
        assert_allclose(line1.get_xydata()[-1],
                     np.array([ 2., -1]))

        assert_allclose(line2.get_xydata()[0],
                     np.array([ 2., 1]))
        assert_allclose(line2.get_xydata()[-1],
                     np.array([ 3., -1]))

        assert_equal(ax1.get_ylabel(), 'RL')
예제 #12
0
    def test_propdict_fig_prop_figsize(self):
        fig = plot_single_material_vs_depth((self.a, self.b), self.xlabels,

                           prop_dict={'fig_prop':{'figsize':(8,9)}})
        assert_allclose(fig.get_size_inches(), (8,9))