当前位置: 首页>>代码示例>>Python>>正文


Python show.show函数代码示例

本文整理汇总了Python中show.show函数的典型用法代码示例。如果您正苦于以下问题:Python show函数的具体用法?Python show怎么用?Python show使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了show函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: drawLine

def drawLine(p1, p2, varargin):
    """Draws a line from point p1 to point p2 and holds the
    current figure
    """

    plt.plot(np.column_stack(p1(1), p2(1)), np.column_stack(p1(2), p2(2)), varargin)
    show()
开发者ID:CercaTrova,项目名称:Coursera-Stanford-ML-Python,代码行数:7,代码来源:drawLine.py

示例2: _show_folder

 def _show_folder(self, index, path, goto, single_pane, other_group):
     if index != -1:
         choice = self.window.folders()[index]
         if path == choice:
             show(self.window, path, goto=goto, single_pane=single_pane, other_group=other_group)
         else:
             show(self.window, choice, single_pane=single_pane, other_group=other_group)
开发者ID:aziz,项目名称:SublimeFileBrowser,代码行数:7,代码来源:dired.py

示例3: open_item

 def open_item(self, fqn, window, new_view):
     if isdir(fqn):
         show(window, fqn, ignore_existing=new_view)
     elif exists(fqn):  # ignore 'item <error>'
         self.last_created_view = window.open_file(fqn)
     else:
         sublime.status_message(u'File does not exist (%s)' % (basename(fqn.rstrip(os.sep)) or fqn))
开发者ID:aziz,项目名称:SublimeFileBrowser,代码行数:7,代码来源:dired.py

示例4: plotBoundary

def plotBoundary(theta, X, y):
    plotDecisionBoundary(theta, X.values, y.values)
    plt.title(r'$\lambda$ = ' + str(Lambda))

    # Labels and Legend
    plt.xlabel('Microchip Test 1')
    plt.ylabel('Microchip Test 2')
    show()
开发者ID:Gabeesh,项目名称:Coursera-Stanford-ML-Python,代码行数:8,代码来源:ex2_reg.py

示例5: run

    def run(self, edit):
        path = self.path
        parent = dirname(path.rstrip(os.sep))
        if parent != os.sep and parent[1:] != ':\\':
            # need to avoid c:\\\\
            parent += os.sep
        if parent == path and NT:
            parent = 'ThisPC'
        elif parent == path:
            return
        elif path == 'ThisPC\\':
            self.view.run_command('dired_refresh')
            return

        view_id = (self.view.id() if reuse_view() else None)
        goto = basename(path.rstrip(os.sep)) or path
        show(self.view.window(), parent, view_id, goto=goto)
开发者ID:aziz,项目名称:SublimeFileBrowser,代码行数:17,代码来源:dired.py

示例6: test_vsm

    def test_vsm(self):
        ds = Document.from_texts([documents.DOCUMENT_1, documents.DOCUMENT_2, documents.DOCUMENT_3])
        vsm = VSM(ds)

        query = "nobel physics britian idea"
        show(query)

        results = vsm.query(query)
        show(results)
开发者ID:CalumJEadie,项目名称:academic,代码行数:9,代码来源:test_question_4.py

示例7: run

    def run(self, edit):
        parent = dirname(self.path.rstrip(os.sep))
        if parent != os.sep:
            parent += os.sep
        if parent == self.path:
            return

        view_id = (self.view.id() if reuse_view() else None)
        show(self.view.window(), parent, view_id, goto=basename(self.path.rstrip(os.sep)))
开发者ID:twistedmove,项目名称:SublimeFileBrowser,代码行数:9,代码来源:dired.py

示例8: train

	def train(self, episode_len, episode_nbr, behavior='balance'):
		tau = 0.001
		speedup = 0.1
		self.pos_log = []
		for j in range(episode_nbr):			
			self.run_episode(episode_len,tau,behavior,'train')
			if (j+1)%100 == 0: print "%i episodes run" % (j+1)
	
		self.run_episode(episode_len,tau,behavior,'show')
		
		show(behavior+'.html',self.pos_log,tau/speedup)
开发者ID:tsybulkin,项目名称:hop2,代码行数:11,代码来源:sim.py

示例9: goto_directory

 def goto_directory(self, filenames, window, new_view):
     '''If reuse view is turned on and the only item is a directory, refresh the existing view'''
     if new_view and reuse_view():
         return False
     fqn = filenames[0]
     if len(filenames) == 1 and isdir(fqn):
         show(self.view.window(), fqn, view_id=self.view.id())
         return True
     elif fqn == PARENT_SYM:
         self.view.window().run_command("dired_up")
         return True
     return False
开发者ID:aziz,项目名称:SublimeFileBrowser,代码行数:12,代码来源:dired.py

示例10: run

def run(tau,T,playback_speedup=1):
	assert tau < 0.1
	assert tau > 0
	assert T > 0

	bot = Robot()
	t = 0
	while t < T:
		bot.next_pos(tau)
		t += tau
		#print '\nt =', t, 'pos:\n', bot.q, bot.q_d
		if bot.fell(): break

	show('no_control.html',bot.state_log,tau/playback_speedup)
开发者ID:tsybulkin,项目名称:jumper,代码行数:14,代码来源:sim.py

示例11: plotData

def plotData(X, y):
    """plots the data points with + for the positive examples
    and o for the negative examples. X is assumed to be a Mx2 matrix.

    Note: This was slightly modified such that it expects y = 1 or y = 0
    """
    plt.figure()

# Find Indices of Positive and Negative Examples
    pos = np.where(y==1, True, False).flatten()
    neg = np.where(y==0, True, False).flatten()

# Plot Examples
    plt.plot(X[pos,0], X[pos, 1], 'k+', linewidth=1, markersize=7)
    plt.plot(X[neg,0], X[neg, 1], 'ko', color='y', markersize=7)
    show()
开发者ID:CercaTrova,项目名称:Coursera-Stanford-ML-Python,代码行数:16,代码来源:plotData.py

示例12: visualizeFit

def visualizeFit(X, mu, sigma2):
    """
    This visualization shows you the
    probability density function of the Gaussian distribution. Each example
    has a location (x1, x2) that depends on its feature values.
    """
    n = np.linspace(0,35,71)
    X1 = np.meshgrid(n,n)
    Z = multivariateGaussian(np.column_stack((X1[0].T.flatten(), X1[1].T.flatten())),mu,sigma2)
    Z = Z.reshape(X1[0].shape)

    plt.plot(X[:, 0], X[:, 1],'bx')
    # Do not plot if there are infinities
    if not isinf(np.sum(Z)):
        plt.contour(X1[0], X1[1], Z, 10.0**np.arange(-20, 0, 3).T)
        show()
开发者ID:Gabeesh,项目名称:Coursera-Stanford-ML-Python,代码行数:16,代码来源:visualizeFit.py

示例13: run

    def run(self, edit, new_view=0, other_group=0, preview=0, and_close=0, inline=0):
        path = self.path
        filenames = self.get_selected() if not new_view else self.get_marked() or self.get_selected()

        # If reuse view is turned on and the only item is a directory, refresh the existing view.
        if not new_view and reuse_view():
            fqn = join(path, filenames[0])
            if inline and '<empty>' == fqn[~6:]:
                return
            if len(filenames) == 1 and isdir(fqn):
                if inline:
                    # if directory was unfolded, then itРђЎll be folded and unfolded again
                    self.view.run_command('dired_fold', {'update': True})
                show(self.view.window(), fqn, view_id=self.view.id(), inline=inline)
                return
            elif len(filenames) == 1 and filenames[0] == PARENT_SYM:
                self.view.window().run_command("dired_up")
                return

        if other_group or preview or and_close:
            # we need group number of FB view, hence twice check for other_group
            dired_view = self.view
            nag = self.view.window().active_group()
        w = self.view.window()
        for filename in filenames:
            fqn = join(path, filename.replace('<empty>', '').rstrip())
            if exists(fqn): # ignore 'item <error>'
                if isdir(fqn):
                    show(w, fqn, ignore_existing=new_view)
                else:
                    if preview:
                        w.focus_group(self._other_group(w, nag))
                        v = w.open_file(fqn, sublime.TRANSIENT)
                        w.set_view_index(v, self._other_group(w, nag), 0)
                        w.focus_group(nag)
                        w.focus_view(dired_view)
                        break # preview is possible for a single file only
                    else:
                        v = w.open_file(fqn)
                        if other_group:
                            w.focus_view(dired_view)
                            w.set_view_index(v, self._other_group(w, nag), 0)
                            w.focus_view(v)
        if and_close:
            w.focus_view(dired_view)
            w.run_command("close")
            w.focus_view(v)
开发者ID:AlexKordic,项目名称:SublimeFileBrowser,代码行数:47,代码来源:dired.py

示例14: on_pick_point

 def on_pick_point(self, index):
     if index == -1:
         return
     name, target = self.points[index]
     if exists(target) and isdir(target) and target[-1] == os.sep:
         show(self.view.window(), target, view_id=self.view.id())
         status_message("Jumping to point '{0}' complete".format(name))
     else:
         # workaround ST3 bag https://github.com/SublimeText/Issues/issues/39
         self.view.window().run_command('hide_overlay')
         msg = u"Can't jump to '{0} → {1}'.\n\nRemove that jump point?".format(name, target)
         if ok_cancel_dialog(msg):
             points = load_jump_points()
             del points[name]
             save_jump_points(points)
             status_message(u"Jump point '{0}' was removed".format(name))
             self.view.run_command('dired_refresh')
开发者ID:AlexKordic,项目名称:SublimeFileBrowser,代码行数:17,代码来源:jumping.py

示例15: run_wss

def run_wss(T, speedup=0.1, tau=0.001):
	bot = Robot()
	bot.q = np.array([0.4, 0., 1.7, 1.35]) 
	bot.psi = 0.5
	
	t = 0.
	while t < T:
		sim_time, action = bot.balance_policy(tau,0.2)
		bot.psi += action/10.
		print "action:",action,"bot state:",bot.q, bot.q_d
		
		[ bot.next_pos(tau) for _ in range(5)]
		t += tau*5

		bot.pos_log.append(tuple(bot.q))
		if bot.is_down(): break

	show('short_sims.html',bot.pos_log,tau/speedup)
开发者ID:tsybulkin,项目名称:hop2,代码行数:18,代码来源:sim.py


注:本文中的show.show函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。