Get X and Y for fine plotting of a stick spectrum.
    Usage: X,Y = getStickXY(TableName).
13427
def getStickXY(TableName):
    
    cent,intens = getColumns(TableName,('nu','sw'))
    n = len(cent)
    cent_ = zeros(n*3)
    intens_ = zeros(n*3)
    for i in range(n):
        intens_[3*i] = 0
        intens_[3*i+1] = intens[i]
        intens_[3*i+2] = 0
        cent_[(3*i):(3*i+3)] = cent[i]
    return cent_,intens_
423619
def y_values_ref(self, series):
        
        top_row = self.series_table_row_offset(series) + 2
        bottom_row = top_row + len(series) - 1
        return "Sheet1!$B$%d:$B$%d" % (top_row, bottom_row)
973002
def get_axis_properties(axis):
    """"""
    props = {}
    label1On = axis._major_tick_kw.get('label1On', True)

    if isinstance(axis, matplotlib.axis.XAxis):
        if label1On:
            props['position'] = "bottom"
        else:
            props['position'] = "top"
    elif isinstance(axis, matplotlib.axis.YAxis):
        if label1On:
            props['position'] = "left"
        else:
            props['position'] = "right"
    else:
        raise ValueError("{0} should be an Axis instance".format(axis))

    # Use tick values if appropriate
    locator = axis.get_major_locator()
    props['nticks'] = len(locator())
    if isinstance(locator, ticker.FixedLocator):
        props['tickvalues'] = list(locator())
    else:
        props['tickvalues'] = None

    # Find tick formats
    formatter = axis.get_major_formatter()
    if isinstance(formatter, ticker.NullFormatter):
        props['tickformat'] = ""
    elif isinstance(formatter, ticker.FixedFormatter):
        props['tickformat'] = list(formatter.seq)
    elif not any(label.get_visible() for label in axis.get_ticklabels()):
        props['tickformat'] = ""
    else:
        props['tickformat'] = None

    # Get axis scale
    props['scale'] = axis.get_scale()

    # Get major tick label size (assumes that's all we really care about!)
    labels = axis.get_ticklabels()
    if labels:
        props['fontsize'] = labels[0].get_fontsize()
    else:
        props['fontsize'] = None

    # Get associated grid
    props['grid'] = get_grid_style(axis)

    return props
677362
def get_projection(self, axis):
        
        scale = axis.dot(self) / axis.dot(axis)
        return axis * scale
1336151
def getRect(self):
		
		return (self.x, self.y, self.w, self.h)
527571
def plot(self, x, y, panel='top', xlabel=None, **kws):
        
        panel = self.get_panel(panel)
        panel.plot(x, y, **kws)
        if xlabel is not None:
            self.xlabel = xlabel
        if self.xlabel is not None:
            self.panel_bot.set_xlabel(self.xlabel)
1089623
def __getX(self):
        '''
        
        '''

        if DEBUG_COORDS:
            print >>sys.stderr, "getX(%s %s ## %s)" % (self.getClass(), self.getId(), self.getUniqueId())
        x = 0

        if self.useUiAutomator:
            x = self.map['bounds'][0][0]
        else:
            try:
                if GET_VISIBILITY_PROPERTY in self.map and self.map[GET_VISIBILITY_PROPERTY] == 'VISIBLE':
                    _x = int(self.map[self.leftProperty])
                    if DEBUG_COORDS: print >>sys.stderr, "   getX: VISIBLE adding %d" % _x
                    x += _x
            except:
                warnings.warn("View %s has no '%s' property" % (self.getId(), self.leftProperty))

        if DEBUG_COORDS: print >>sys.stderr, "   getX: returning %d" % (x)
        return x
271343
def _get_axis(self, array, axis, slice_num,
                  extended=False,
                  transpose=True):
        """"""

        slice_list = [slice(None)] * array.ndim
        slice_list[axis] = slice_num
        slice_data = array[tuple(slice_list)]
        if transpose:  # for proper orientation
            slice_data = slice_data.T

        if not extended:
            # return just the slice data
            return slice_data
        else:
            # additionally include which dim and which slice num
            return axis, slice_num, slice_data
155643
def mapFromChart( self, x, y ):
        
        grid      = self.gridRect()
        hruler    = self.horizontalRuler()
        vruler    = self.verticalRuler()
        
        xperc     = hruler.percentAt(x)
        yperc     = vruler.percentAt(y)
        
        xoffset   = grid.width() * xperc
        yoffset   = grid.height() * yperc
        
        xpos      = grid.left() + xoffset
        ypos      = grid.bottom() - yoffset
        
        return QPointF(xpos, ypos)
508236
def ydtick(self, dtick, index=1):
        """"""
        self.layout['yaxis' + str(index)]['dtick'] = dtick
        return self
990410
def getDXGIOutputInfo(self):
        

        fn = self.function_table.getDXGIOutputInfo
        pnAdapterIndex = c_int32()
        fn(byref(pnAdapterIndex))
        return pnAdapterIndex.value
1002715
def plotit(self, x, y, fields, colors=[]):
        ''''''
        pylab.ion()
        fig = pylab.figure(num=1, figsize=(12,6))
        ax1 = fig.gca()
        ax2 = None
        xrange = 0.0
        for i in range(0, len(fields)):
            if len(x[i]) == 0: continue
            if self.lowest_x is None or x[i][0] < self.lowest_x:
                self.lowest_x = x[i][0]
            if self.highest_x is None or x[i][-1] > self.highest_x:
                self.highest_x = x[i][-1]
        if self.highest_x is None or self.lowest_x is None:
            return
        xrange = self.highest_x - self.lowest_x
        xrange *= 24 * 60 * 60
        self.formatter = matplotlib.dates.DateFormatter('%H:%M:%S')
        interval = 1
        intervals = [ 1, 2, 5, 10, 15, 30, 60, 120, 240, 300, 600,
                      900, 1800, 3600, 7200, 5*3600, 10*3600, 24*3600 ]
        for interval in intervals:
            if xrange / interval < 15:
                break
        locator = matplotlib.dates.SecondLocator(interval=interval)
        if not self.xaxis:
            ax1.xaxis.set_major_locator(locator)
            ax1.xaxis.set_major_formatter(self.formatter)
        empty = True
        ax1_labels = []
        ax2_labels = []

        for i in range(0, len(fields)):
            if len(x[i]) == 0:
                print("Failed to find any values for field %s" % fields[i])
                continue
            if i < len(colors):
                color = colors[i]
            else:
                color = 'red'
                (tz, tzdst) = time.tzname

            if self.axes[i] == 2:
                if ax2 == None:
                    ax2 = ax1.twinx()
                    ax2.format_coord = self.make_format(ax2, ax1)
                ax = ax2
                if not self.xaxis:
                    ax2.xaxis.set_major_locator(locator)
                    ax2.xaxis.set_major_formatter(self.formatter)
                label = fields[i]
                if label.endswith(":2"):
                    label = label[:-2]
                ax2_labels.append(label)
            else:
                ax1_labels.append(fields[i])
                ax = ax1
            
            if self.xaxis:
                if self.marker is not None:
                    marker = self.marker
                else:
                    marker = '+'
                if self.linestyle is not None:
                    linestyle = self.linestyle
                else:
                    linestyle = 'None'
                ax.plot(x[i], y[i], color=color, label=fields[i],
                        linestyle=linestyle, marker=marker)
            else:
                if self.marker is not None:
                    marker = self.marker
                else:
                    marker = 'None'
                if self.linestyle is not None:
                    linestyle = self.linestyle
                else:
                    linestyle = '-'
                ax.plot_date(x[i], y[i], color=color, label=fields[i],
                             linestyle=linestyle, marker=marker, tz=None)

            empty = False
            if self.flightmode is not None:
                for i in range(len(self.modes)-1):
                    c = colourmap[self.flightmode].get(self.modes[i][1], edge_colour)
                    ax1.axvspan(self.modes[i][0], self.modes[i+1][0], fc=c, ec=edge_colour, alpha=0.1)
                c = colourmap[self.flightmode].get(self.modes[-1][1], edge_colour)
                ax1.axvspan(self.modes[-1][0], ax1.get_xlim()[1], fc=c, ec=edge_colour, alpha=0.1)

            if ax1_labels != []:
                ax1.legend(ax1_labels,loc=self.legend)
            if ax2_labels != []:
                ax2.legend(ax2_labels,loc=self.legend2)
            if empty:
                print("No data to graph")
                return
1314399
def _chart(self, x, y, chart_type, opts, style, label, options, **kwargs):
		
		if opts is not None:
			self.chart_opts = opts
		if style is not None:
			self.chart_style = style
		if label is not None:
			self.label = label
		self.x = x
		self.y = y
		if chart_type is None:
			return
		try:
			chart_obj = self._get_chart(chart_type, x, y, style=style,
										opts=opts, label=label,
										options=options, **kwargs)
			return chart_obj
		except Exception as e:
			self.err(e)
1236838
def _get_ticks(self, opts):
        
        opts, _ = self._get_opts(opts, None)
        if "xticks" not in opts:
            if "xticks" not in self.chart_opts:
                self.err(self.dlinear_,
                         "Please set the xticks option for this chart to work")
                return
            else:
                xticks = self.chart_opts["xticks"]
        else:
            xticks = opts["xticks"]
        if "yticks" not in opts:
            if "yticks"not in self.chart_opts:
                self.err(self.dlinear_,
                         "Please set the yticks option for this chart to work")
                return
            else:
                yticks = self.chart_opts["yticks"]
        else:
            yticks = opts["yticks"]
        return xticks, yticks
1241640
def _x_axis(self):
        """"""
        if not self._x_labels or not self.show_x_labels:
            return
        axis = self.svg.node(
            self.nodes['plot'],
            class_="axis x%s" % (' always_show' if self.show_x_guides else '')
        )
        truncation = self.truncate_label
        if not truncation:
            if self.x_label_rotation or len(self._x_labels) <= 1:
                truncation = 25
            else:
                first_label_position = self.view.x(self._x_labels[0][1]) or 0
                last_label_position = self.view.x(self._x_labels[-1][1]) or 0
                available_space = (last_label_position - first_label_position
                                   ) / len(self._x_labels) - 1

                truncation = reverse_text_len(
                    available_space, self.style.label_font_size
                )
                truncation = max(truncation, 1)

        lastlabel = self._x_labels[-1][0]
        if 0 not in [label[1] for label in self._x_labels]:
            self.svg.node(
                axis,
                'path',
                d='M%f %f v%f' % (0, 0, self.view.height),
                class_='line'
            )
            lastlabel = None

        for label, position in self._x_labels:
            if self.horizontal:
                major = position in self._x_labels_major
            else:
                major = label in self._x_labels_major
            if not (self.show_minor_x_labels or major):
                continue
            guides = self.svg.node(axis, class_='guides')
            x = self.view.x(position)
            if x is None:
                continue
            y = self.view.height + 5
            last_guide = (self._y_2nd_labels and label == lastlabel)
            self.svg.node(
                guides,
                'path',
                d='M%f %f v%f' % (x or 0, 0, self.view.height),
                class_='%s%s%sline' % (
                    'axis ' if label == "0" else '', 'major '
                    if major else '', 'guide '
                    if position != 0 and not last_guide else ''
                )
            )
            y += .5 * self.style.label_font_size + 5
            text = self.svg.node(
                guides, 'text', x=x, y=y, class_='major' if major else ''
            )

            text.text = truncate(label, truncation)
            if text.text != label:
                self.svg.node(guides, 'title').text = label
            elif self._dual:
                self.svg.node(
                    guides,
                    'title',
                ).text = self._x_format(position)

            if self.x_label_rotation:
                text.attrib['transform'] = "rotate(%d %f %f)" % (
                    self.x_label_rotation, x, y
                )
                if self.x_label_rotation >= 180:
                    text.attrib['class'] = ' '.join((
                        text.attrib['class']
                        and text.attrib['class'].split(' ') or []
                    ) + ['backwards'])

        if self._y_2nd_labels and 0 not in [label[1]
                                            for label in self._x_labels]:
            self.svg.node(
                axis,
                'path',
                d='M%f %f v%f' % (self.view.width, 0, self.view.height),
                class_='line'
            )

        if self._x_2nd_labels:
            secondary_ax = self.svg.node(
                self.nodes['plot'],
                class_="axis x x2%s" %
                (' always_show' if self.show_x_guides else '')
            )
            for label, position in self._x_2nd_labels:
                major = label in self._x_labels_major
                if not (self.show_minor_x_labels or major):
                    continue
                # it is needed, to have the same structure as primary axis
                guides = self.svg.node(secondary_ax, class_='guides')
                x = self.view.x(position)
                y = -5
                text = self.svg.node(
                    guides, 'text', x=x, y=y, class_='major' if major else ''
                )
                text.text = label
                if self.x_label_rotation:
                    text.attrib['transform'] = "rotate(%d %f %f)" % (
                        -self.x_label_rotation, x, y
                    )
                    if self.x_label_rotation >= 180:
                        text.attrib['class'] = ' '.join((
                            text.attrib['class']
                            and text.attrib['class'].split(' ') or []
                        ) + ['backwards'])
522364
def getPixelAttrMost(self, x, y):
        ''
        r = self.pixels[y][x]
        c = sorted((len(rows), attr, rows) for attr, rows in list(r.items()) if attr and attr not in self.hiddenAttrs)
        if not c:
            return 0
        _, attr, rows = c[-1]
        if isinstance(self.source, BaseSheet) and anySelected(self.source, rows):
            attr = CursesAttr(attr, 8).update_attr(colors.color_graph_selected, 10).attr
        return attr
1052869
public Point getScreenCoords (int x, int y)
    {
        return MisoUtil.fullToScreen(_metrics, x, y, new Point());
    }