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


Python SSUtilities.increaseMinMax方法代码示例

本文整理汇总了Python中SSUtilities.increaseMinMax方法的典型用法代码示例。如果您正苦于以下问题:Python SSUtilities.increaseMinMax方法的具体用法?Python SSUtilities.increaseMinMax怎么用?Python SSUtilities.increaseMinMax使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SSUtilities的用法示例。


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

示例1: createOutputGraphic

# 需要导入模块: import SSUtilities [as 别名]
# 或者: from SSUtilities import increaseMinMax [as 别名]
    def createOutputGraphic(self, fileName, firstInd = None, maxInd = None):

        #### Set Progressor ####
        writeMSG = ARCPY.GetIDMessage(84186)
        ARCPY.SetProgressor("step", writeMSG, 0, 3, 1)
        ARCPY.AddMessage(writeMSG)

        #### Set Colors ####
        colors = NUM.array(["#4575B5", "#849EBA", "#C0CCBE", "#FFFFBF",
          "#FAB984", "#ED7551", "#D62F27"])
        cutoffs = NUM.array([-2.58, -1.96, -1.65, 1.65, 1.96, 2.58])

        #### Import Matplotlib ####
        pdfOutput = REPORT.openPDF(fileName)

        #### Set Base Figure ####
        title = ARCPY.GetIDMessage(84334)
        report = REPORT.startNewReport(22, title = title, landscape = True,
                                       titleFont = REPORT.ssTitleFont)
        grid = report.grid
        startRow = 1
        gridPlot = PLT.subplot2grid(grid.gridInfo, (startRow, 0),
                                    colspan = 20, rowspan = 16)

        #### Set Data ####
        distVals = []
        zVals = []
        for testIter in range(self.nIncrements):
            d, gi, ei, vi, zi, pv = self.giResults[testIter]
            distVals.append(d)
            zVals.append(zi)

        #### Plot Values ####
        zVals = NUM.array(zVals)
        binVals = NUM.digitize(zVals, cutoffs)
        binColors = colors[binVals]

        #### Line Graph First ####
        lines = PLT.plot(distVals, zVals, color='k', linestyle='-')

        #### Add Series and First/Max Points ####
        if firstInd != None:
            #### First Peak ####
            firstPoint = PLT.plot(distVals[firstInd], zVals[firstInd],
                                  color='#00FFFF', marker='o', alpha = 0.7,
                                  markeredgecolor='k', markersize = 14)

        if maxInd != None:
            #### Max Peak ####
            if maxInd != firstInd:
                maxPoint = PLT.plot(distVals[maxInd], zVals[maxInd],
                                    color='#00FFFF', marker='o', alpha = 0.7,
                                    markeredgecolor='k', markersize = 14)

        #### Points Next ####
        for ind, dist in enumerate(distVals):
            color = binColors[ind]
            points = PLT.plot(dist, zVals[ind], color=color, marker='o',
                              alpha = 0.7, markeredgecolor='k',
                              markersize = 8)

        #### Set Axis and Tick Labels ####
        yLabel = ARCPY.GetIDMessage(84335)
        distanceOut = self.ssdo.distanceInfo.outputString
        xLabel = ARCPY.GetIDMessage(84077).format(distanceOut)
        PYLAB.ylabel(yLabel, fontproperties = REPORT.ssLabFont, labelpad = 20)
        PYLAB.xlabel(xLabel, fontproperties = REPORT.ssLabFont, labelpad = 20)
        gridPlot.yaxis.grid(True, linestyle='-', which='major',
                            color='lightgrey', alpha=0.5)
        REPORT.setTickFontSize(gridPlot)

        #### Scoot Max Z ####
        minD, maxD = UTILS.increaseMinMax(distVals, multiplier = .15)
        minZ, maxZ = UTILS.increaseMinMax(zVals, multiplier = .15)
        PYLAB.ylim(ymin = minZ, ymax = maxZ)
        PYLAB.xlim(xmin = minD, xmax = maxD)

        #### Create Legend ####
        rColors = [ i for i in reversed(colors) ]
        grid.writeCell((startRow, 20), yLabel, colspan = 2,
                        fontObj = REPORT.ssBoldFont, justify = "right")
        labels = ["> 2.58", "1.96 - 2.58", "1.65 - 1.96", "-1.65 - 1.65",
                  "-1.96 - -1.65", "-2.58 - -1.96", "< -2.58"]

        gridCount = 0
        for ind, lab in enumerate(labels):
            color = rColors[ind]
            row = ind + 1 + startRow
            gridCount += 1

            #### Add Points ####
            gridLegend = PLT.subplot2grid(grid.gridInfo, (row, 20))
            PLT.plot(0.0, 0.0, color = color, marker = "o", alpha = .7)
            REPORT.clearGrid(gridLegend)

            #### Add Text ####
            gridLegend = PLT.subplot2grid(grid.gridInfo, (row, 21))
            PLT.text(0.0, 0.3, lab, fontproperties = REPORT.ssFont,
                     horizontalalignment = "left")
            REPORT.clearGrid(gridLegend)
#.........这里部分代码省略.........
开发者ID:rvinc66,项目名称:ArcGISRuntimeBook,代码行数:103,代码来源:MoransI_Increment.py


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