當前位置: 首頁>>代碼示例>>Python>>正文


Python Plot.set_padding方法代碼示例

本文整理匯總了Python中plot.Plot.set_padding方法的典型用法代碼示例。如果您正苦於以下問題:Python Plot.set_padding方法的具體用法?Python Plot.set_padding怎麽用?Python Plot.set_padding使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在plot.Plot的用法示例。


在下文中一共展示了Plot.set_padding方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: set_source

# 需要導入模塊: from plot import Plot [as 別名]
# 或者: from plot.Plot import set_padding [as 別名]
 def set_source(self,source,nodes=None):
     """
     Handles opening a new file. Creates a plot with the given source
     file. Uses input plugins to convert file to SVG. This disregards
     all previous settings, thus ui_updates should be called.
     """
     height = self.material.length and self.material.length*UNITS[self.units] or None
     p = Plot(width=self.material.width*UNITS[self.units],height=height,color=self.material.color)
     m = self.material.margin
     p.set_padding(top=m[0],right=m[1],bottom=m[2],left=m[3])
     if type(source) == etree._ElementTree:
         try:
             # If certain nodes are selected, only plot them.
             if nodes:
                 xml = etree.tostring(get_selected_nodes(source,nodes))
             else:
                 xml = etree.tostring(source)
             # Set a job name if none exists
             if self.name is None:
                 self.name = "*inkscape.svg"
             # Try to make a plot
             p.set_graphic(xml)
             self.plot = p
         except (IOError,etree.XMLSyntaxError),trace:
             log.debug(trace)
             raise Exception("Failed to create plot. Reason: Failed to import the Inkscape file.")
開發者ID:pc-coholic,項目名稱:Inkcut,代碼行數:28,代碼來源:job.py


注:本文中的plot.Plot.set_padding方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。