Пример #1
0
    def plot_iteration(self, index, t):
        """ Plots an iteration (a probability distribution). 

		The iteration has to exist.

		index: index of the distribution of which the iteration should be plotted
		t: iteration time
		"""
        import matplotlib.pyplot as plt

        iteration = self.get_iteration(index, t)

        mkm.pyplot_bar(iteration)

        plt.title("Probability distribution after %d steps" % (t))
        plt.xlabel("Markov chain state space")
        plt.ylabel("Probabiliy")

        plt.tick_params(axis='x',
                        which='both',
                        bottom='off',
                        top='off',
                        labelbottom='off')

        plt.xlim(0, self.n)
        plt.ylim(0, 1.1 * numpy.max(iteration))

        plt.show()
Пример #2
0
		def frame(i):
			fig = plt.figure(figsize=(19.20, 10.80), dpi=100)

			# time of closest iteration
			t = self.closest_iteration_time(index,i*frametime)

			iteration = self.get_iteration(index,t)
			mkm.pyplot_bar(iteration)
		
			plt.title("Probability distribution after %d steps" % (t))
			plt.xlabel("Markov chain state space")
			plt.ylabel("Probabiliy")

			plt.tick_params(axis='x', which='both', bottom='off', top='off', labelbottom='off')
		
			plt.xlim(0, self.n)
			plt.ylim(0, 1.1*numpy.max(iteration))

			return fig
Пример #3
0
        def frame(i):
            fig = plt.figure(figsize=(19.20, 10.80), dpi=100)

            # time of closest iteration
            t = self.closest_iteration_time(index, i * frametime)

            iteration = self.get_iteration(index, t)
            mkm.pyplot_bar(iteration)

            plt.title("Probability distribution after %d steps" % (t))
            plt.xlabel("Markov chain state space")
            plt.ylabel("Probabiliy")

            plt.tick_params(axis='x',
                            which='both',
                            bottom='off',
                            top='off',
                            labelbottom='off')

            plt.xlim(0, self.n)
            plt.ylim(0, 1.1 * numpy.max(iteration))

            return fig
Пример #4
0
	def plot_iteration(self,index,t):
		""" Plots an iteration (a probability distribution). 

		The iteration has to exist.

		index: index of the distribution of which the iteration should be plotted
		t: iteration time
		"""
		import matplotlib.pyplot as plt

		iteration = self.get_iteration(index,t)

		mkm.pyplot_bar(iteration)

		plt.title("Probability distribution after %d steps" % (t))
		plt.xlabel("Markov chain state space")
		plt.ylabel("Probabiliy")

		plt.tick_params(axis='x', which='both', bottom='off', top='off', labelbottom='off')
		
		plt.xlim(0, self.n)
		plt.ylim(0, 1.1*numpy.max(iteration))

		plt.show()