Create and return axes on this pad
772487
def axes(self, ndim=1,
             xlimits=None, ylimits=None, zlimits=None,
             xbins=1, ybins=1, zbins=1):
        
        if xlimits is None:
            xlimits = (0, 1)
        if ylimits is None:
            ylimits = (0, 1)
        if zlimits is None:
            zlimits = (0, 1)
        if ndim == 1:
            from .hist import Hist
            hist = Hist(1, xlimits[0], xlimits[1])
        elif ndim == 2:
            from .hist import Hist2D
            hist = Hist2D(1, xlimits[0], xlimits[1],
                          1, ylimits[0], ylimits[1])
        elif ndim == 3:
            from .hist import Hist3D
            hist = Hist3D(1, xlimits[0], xlimits[1],
                          1, ylimits[0], ylimits[1],
                          1, zlimits[0], zlimits[1])
        else:
            raise ValueError("ndim must be 1, 2, or 3")
        with self:
            hist.Draw('AXIS')
        xaxis = hist.xaxis
        yaxis = hist.yaxis
        if isinstance(xbins, (list, tuple)):
            xbins = array('d', xbins)
        if hasattr(xbins, '__iter__'):
            xaxis.Set(len(xbins) - 1, xbins)
        else:
            xaxis.Set(xbins, *xlimits)
        if ndim > 1:
            if isinstance(ybins, (list, tuple)):
                ybins = array('d', ybins)
            if hasattr(ybins, '__iter__'):
                yaxis.Set(len(ybins) - 1, ybins)
            else:
                yaxis.Set(ybins, *ylimits)
        else:
            yaxis.limits = ylimits
            yaxis.range_user = ylimits
        if ndim > 1:
            zaxis = hist.zaxis
            if ndim == 3:
                if isinstance(zbins, (list, tuple)):
                    zbins = array('d', zbins)
                if hasattr(zbins, '__iter__'):
                    zaxis.Set(len(zbins) - 1, zbins)
                else:
                    zaxis.Set(zbins, *zlimits)
            else:
                zaxis.limits = zlimits
                zaxis.range_user = zlimits
            return xaxis, yaxis, zaxis
        return xaxis, yaxis
574321
def values(self, axis=None):
        
        if axis is None:
            return self._plot
        else:
            return [value.get(axis) for value in self._plot]
920415
def initialize_axes(self, boundary=0.05):
        """"""
        bs = [(self.vals[:, i].max()-self.vals[:, i].min())*boundary for i in range(3)]
        self.x_lim = np.array([self.vals[:, 0].min()-bs[0], self.vals[:, 0].max()+bs[0]])
        self.y_lim = np.array([self.vals[:, 1].min()-bs[1], self.vals[:, 1].max()+bs[1]])
        self.z_lim = np.array([self.vals[:, 2].min()-bs[2], self.vals[:, 2].max()+bs[2]])
1177127
def _extract_axes_for_slice(self, axes):
        
        return {self._AXIS_SLICEMAP[i]: a for i, a in
                zip(self._AXIS_ORDERS[self._AXIS_LEN - len(axes):], axes)}
26930
def pad_to_power2(data, axis = None, mode="constant"):
    
    if axis is None:
        axis = list(range(data.ndim))

    if np.all([_is_power2(n) for i, n in enumerate(data.shape) if i in axis]):
        return data
    else:
        return pad_to_shape(data,[(_next_power_of_2(n) if i in axis else n) for i,n in enumerate(data.shape)], mode)
730867
def pad_plots(plots):
    
    widths = []
    for row in plots:
        row_widths = []
        for p in row:
            width = pad_width(p)
            row_widths.append(width)
        widths.append(row_widths)
    plots = [[WidgetBox(p, width=w) if isinstance(p, (DataTable, Tabs)) else p
              for p, w in zip(row, ws)] for row, ws in zip(plots, widths)]
    return plots
912014
def get(self):
        
        return {k:v for k,v in list(self.options.items()) if k in self._allowed_axes}
358650
def swapaxes(self, axis1, axis2, copy=True):
        
        i = self._get_axis_number(axis1)
        j = self._get_axis_number(axis2)

        if i == j:
            if copy:
                return self.copy()
            return self

        mapping = {i: j, j: i}

        new_axes = (self._get_axis(mapping.get(k, k))
                    for k in range(self._AXIS_LEN))
        new_values = self.values.swapaxes(i, j)
        if copy:
            new_values = new_values.copy()

        return self._constructor(new_values, *new_axes).__finalize__(self)
1367454
def from_semiaxes(cls,axes):
        
        ax = list(1/N.array(axes)**2)
        #ax[-1] *= -1  # Not sure what is going on here...
        arr = N.diag(ax + [-1])
        return arr.view(cls)
695243
function buildAxis(){
            xAxis = d3Axis.axisBottom(xScale);

            yAxis = d3Axis.axisLeft(yScale)
                .ticks(yTicks)
                .tickPadding(yTickPadding)
                .tickFormat(yAxisTickFormat);
        }
143348
def _call(self, x, out=None):
        """"""
        if out is None:
            out = self.range.zero()
        else:
            out.set_zero()

        x_arr = x.asarray()
        out_arr = out.asarray()
        tmp = np.empty(out.shape, out.dtype, order=out.space.default_order)

        ndim = self.domain.ndim
        dx = self.domain.cell_sides

        with writable_array(out) as out_arr:
            for axis in range(ndim):
                # TODO: this can be optimized
                finite_diff(x_arr, axis=axis, dx=dx[axis] ** 2,
                            method='forward',
                            pad_mode=self.pad_mode,
                            pad_const=self.pad_const, out=tmp)

                out_arr += tmp

                finite_diff(x_arr, axis=axis, dx=dx[axis] ** 2,
                            method='backward',
                            pad_mode=self.pad_mode,
                            pad_const=self.pad_const, out=tmp)

                out_arr -= tmp

        return out
472000
def Pad(self, n):
        """"""
        for i in range_func(n):
            self.Place(0, N.Uint8Flags)
1084766
def axes=(axes)
      idx = 0
      @axes, @axis_labels, @axis_ranges = [], [], []
      [:x, :y, :r, :t].each do |axis|
        case axes[axis]
        when Array
          @axis_labels << ("#{idx}:|" + axes[axis].map {|l| CGI::escape(l.to_s) }.join('|'))
          @axes << axis
          idx += 1
        when Range
          @axis_ranges << ("#{idx},#{axes[axis].first},#{axes[axis].last}")
          @axes << axis
          idx += 1
        when true
          @axes << axis
          idx += 1
        end
      end
    end
1329509
function ( axis, startX, startY, endX, endY ) {
        var result = 'none';

        if ( axis == 'horizontal' ) {
            if ( startX > endX ) {
                result = 'left';
            } else if ( startX < endX ) {
                result = 'right';
            }
        } else {
            if ( startY > endY ) {
                result = 'top';
            } else if ( startY < endY ) {
                result = 'bottom';
            }
        }

        return result;
    }
412651
def _reassigned_axes_event(event, ax):
    """"""
    event = copy.copy(event)
    event.xdata, event.ydata = (
        ax.transData.inverted().transform_point((event.x, event.y)))
    return event
1330033
def _get_axis_dims(self, element):
        
        dims = element.dimensions()[:3]
        pad = [None]*max(3-len(dims), 0)
        return dims + pad
900491
def axis(self) -> Callable[[Any], Any]:
        
        axis_func = hist_axis_func(
            axis_type = self.axis_type
        )
        return axis_func