The plotter class
181966
def plotter_cls(self):
        """"""
        ret = self._plotter_cls
        if ret is None:
            self._logger.debug('importing %s', self.module)
            mod = import_module(self.module)
            plotter = self.plotter_name
            if plotter not in vars(mod):
                raise ImportError("Module %r does not have a %r plotter!" % (
                    mod, plotter))
            ret = self._plotter_cls = getattr(mod, plotter)
            _versions.update(get_versions(key=lambda s: s == self._plugin))
        return ret
1207862
def PlotFactory(xChart, chart):
    
    try:
        PlotCls = {
            qn('c:areaChart'):     AreaPlot,
            qn('c:area3DChart'):   Area3DPlot,
            qn('c:barChart'):      BarPlot,
            qn('c:bubbleChart'):   BubblePlot,
            qn('c:doughnutChart'): DoughnutPlot,
            qn('c:lineChart'):     LinePlot,
            qn('c:pieChart'):      PiePlot,
            qn('c:radarChart'):    RadarPlot,
            qn('c:scatterChart'):  XyPlot,
        }[xChart.tag]
    except KeyError:
        raise ValueError('unsupported plot type %s' % xChart.tag)

    return PlotCls(xChart, chart)
398754
private RectangleArranger<PlotItem> arrangeVisualizations(double width, double height) {
    if(!(width > 0. && height > 0.)) {
      LOG.warning("No size information during arrange()", new Throwable());
      return new RectangleArranger<>(1., 1.);
    }
    RectangleArranger<PlotItem> plotmap = new RectangleArranger<>(width, height);

    Hierarchy<Object> vistree = context.getVisHierarchy();
    for(It<Projector> iter2 = vistree.iterAll().filter(Projector.class); iter2.valid(); iter2.advance()) {
      Collection<PlotItem> projs = iter2.get().arrange(context);
      for(PlotItem it : projs) {
        if(it.w <= 0.0 || it.h <= 0.0) {
          LOG.warning("Plot item with improper size information: " + it);
          continue;
        }
        plotmap.put(it.w, it.h, it);
      }
    }

    nextTask: for(It<VisualizationTask> iter2 = vistree.iterAll().filter(VisualizationTask.class); iter2.valid(); iter2.advance()) {
      VisualizationTask task = iter2.get();
      if(!task.isVisible()) {
        continue;
      }
      if(vistree.iterParents(task).filter(Projector.class).valid()) {
        continue nextTask;
      }
      if(task.getRequestedWidth() <= 0.0 || task.getRequestedHeight() <= 0.0) {
        LOG.warning("Task with improper size information: " + task);
        continue;
      }
      PlotItem it = new PlotItem(task.getRequestedWidth(), task.getRequestedHeight(), null);
      it.tasks.add(task);
      plotmap.put(it.w, it.h, it);
    }
    return plotmap;
  }
175823
def get_plot(self_or_cls, obj, renderer=None, **kwargs):
        
        if isinstance(obj, DynamicMap) and obj.unbounded:
            dims = ', '.join('%r' % dim for dim in obj.unbounded)
            msg = ('DynamicMap cannot be displayed without explicit indexing '
                   'as {dims} dimension(s) are unbounded. '
                   '\nSet dimensions bounds with the DynamicMap redim.range '
                   'or redim.values methods.')
            raise SkipRendering(msg.format(dims=dims))

        # Initialize DynamicMaps with first data item
        initialize_dynamic(obj)

        if not isinstance(obj, Plot):
            if not displayable(obj):
                obj = collate(obj)
                initialize_dynamic(obj)
            obj = Compositor.map(obj, mode='data', backend=self_or_cls.backend)

        if not renderer:
            renderer = self_or_cls
            if not isinstance(self_or_cls, Renderer):
                renderer = self_or_cls.instance()
        if not isinstance(obj, Plot):
            obj = Layout.from_values(obj) if isinstance(obj, AdjointLayout) else obj
            plot_opts = dict(self_or_cls.plot_options(obj, self_or_cls.size),
                             **kwargs)
            plot = self_or_cls.plotting_class(obj)(obj, renderer=renderer,
                                                   **plot_opts)
            defaults = [kd.default for kd in plot.dimensions]
            init_key = tuple(v if d is None else d for v, d in
                             zip(plot.keys[0], defaults))
            plot.update(init_key)
        else:
            plot = obj
        return plot
813936
def plotit(self):
        '''
        
        '''
        [self._plot(i) for i in range(len(self.plots))]
817490
def create_plots(self):
        
        for i, axis in enumerate(self.ax):
            # plot everything. First check general dict for parameters related to plots.
            trans_plot_class_call = globals()[self.plot_types[i]]
            trans_plot_class = trans_plot_class_call(self.fig, axis,
                                                     self.value_classes[i].x_arr_list,
                                                     self.value_classes[i].y_arr_list,
                                                     self.value_classes[i].z_arr_list,
                                                     colorbar=(
                                                        self.colorbar_classes[self.plot_types[i]]),
                                                     **{**self.general,
                                                        **self.figure,
                                                        **self.plot_info[str(i)],
                                                        **self.plot_info[str(i)]['limits'],
                                                        **self.plot_info[str(i)]['label'],
                                                        **self.plot_info[str(i)]['extra'],
                                                        **self.plot_info[str(i)]['legend']})

            # create the plot
            trans_plot_class.make_plot()

            # setup the plot
            trans_plot_class.setup_plot()

            # print("Axis", i, "Complete")
        return
22421
def show(self, *args, **kwargs):
        
        plt = self.get_pourbaix_plot(*args, **kwargs)
        plt.show()
37672
def plotGenCost(generators):
    
    figure()
    plots = []
    for generator in generators:
        if generator.pcost_model == PW_LINEAR:
            x = [x for x, _ in generator.p_cost]
            y = [y for _, y in generator.p_cost]
        elif generator.pcost_model == POLYNOMIAL:
            x = scipy.arange(generator.p_min, generator.p_max, 5)
            y = scipy.polyval(scipy.array(generator.p_cost), x)
        else:
            raise
        plots.append(plot(x, y))
        xlabel("P (MW)")
        ylabel("Cost ($)")
    legend(plots, [g.name for g in generators])
    show()
23885
def plot(self, f, lfilter=None,**kargs):
        """"""

        return plt.plot([ f(i) for i in self.res if not lfilter or lfilter(i) ], **kargs)
629829
def plotres(psr,deleted=False,group=None,**kwargs):
    """"""

    res, t, errs = psr.residuals(), psr.toas(), psr.toaerrs
    
    if (not deleted) and N.any(psr.deleted != 0):
        res, t, errs = res[psr.deleted == 0], t[psr.deleted == 0], errs[psr.deleted == 0]
        print("Plotting {0}/{1} nondeleted points.".format(len(res),psr.nobs))

    meanres = math.sqrt(N.mean(res**2)) / 1e-6
    
    if group is None:
        i = N.argsort(t)
        P.errorbar(t[i],res[i]/1e-6,yerr=errs[i],fmt='x',**kwargs)
    else:
        if (not deleted) and N.any(psr.deleted):
            flagmask = psr.flagvals(group)[~psr.deleted]
        else:
            flagmask = psr.flagvals(group)

        unique = list(set(flagmask))
            
        for flagval in unique:
            f = (flagmask == flagval)
            flagres, flagt, flagerrs = res[f], t[f], errs[f]
            i = N.argsort(flagt)
            P.errorbar(flagt[i],flagres[i]/1e-6,yerr=flagerrs[i],fmt='x',**kwargs)
        
        P.legend(unique,numpoints=1,bbox_to_anchor=(1.1,1.1))

    P.xlabel('MJD'); P.ylabel('res [us]')
    P.title("{0} - rms res = {1:.2f} us".format(psr.name,meanres))
497397
def draw(self):
        

        indices = np.arange(len(self.classes_))
        prev = np.zeros(len(self.classes_))

        colors = resolve_colors(
            colors=self.colors,
            n_colors=len(self.classes_))

        for idx, row in enumerate(self.predictions_):
            self.ax.bar(indices, row, label=self.classes_[idx],
                        bottom=prev, color=colors[idx])
            prev += row

        return self.ax
332973
def p_Class(p):
    '''
    
    '''
    p[0] = Class(p[1], p[2], p[4], p[5], p[6], p[8], p[9])
103104
def draw(self, X, y, **kwargs):
        
        # Convert from dataframe
        if is_dataframe(X):
            X = X.values

        # Clean out nans and warn that the user they aren't plotted
        nan_warnings.warn_if_nans_exist(X)
        X, y = nan_warnings.filter_missing(X, y)

        # Get the shape of the data
        nrows, ncols = X.shape

        # Set the axes limits
        self.ax.set_xlim([-1,1])
        self.ax.set_ylim([-1,1])

        # Create the colors
        # TODO: Allow both colormap, listed colors, and palette definition
        # TODO: Make this an independent function or property for override!
        color_values = resolve_colors(
            n_colors=len(self.classes_), colormap=self.colormap, colors=self.color
        )
        self._colors = dict(zip(self.classes_, color_values))

        # Create a data structure to hold scatter plot representations
        to_plot = {}
        for kls in self.classes_:
            to_plot[kls] = [[], []]

        # Compute the arcs around the circumference for each feature axis
        # TODO: make this an independent function for override
        s = np.array([
                (np.cos(t), np.sin(t))
                for t in [
                    2.0 * np.pi * (i / float(ncols))
                    for i in range(ncols)
                ]
            ])

        # Compute the locations of the scatter plot for each class
        # Normalize the data first to plot along the 0, 1 axis
        for i, row in enumerate(self.normalize(X)):
            row_ = np.repeat(np.expand_dims(row, axis=1), 2, axis=1)
            xy   = (s * row_).sum(axis=0) / row.sum()
            kls = self.classes_[y[i]]

            to_plot[kls][0].append(xy[0])
            to_plot[kls][1].append(xy[1])

        # Add the scatter plots from the to_plot function
        # TODO: store these plots to add more instances to later
        # TODO: make this a separate function
        for i, kls in enumerate(self.classes_):
            self.ax.scatter(
                to_plot[kls][0], to_plot[kls][1], color=self._colors[kls],
                label=str(kls), alpha=self.alpha, **kwargs
            )

        # Add the circular axis path
        # TODO: Make this a seperate function (along with labeling)
        self.ax.add_patch(patches.Circle(
            (0.0, 0.0), radius=1.0, facecolor='none', edgecolor='grey', linewidth=.5
        ))

        # Add the feature names
        for xy, name in zip(s, self.features_):
            # Add the patch indicating the location of the axis
            self.ax.add_patch(patches.Circle(xy, radius=0.025, facecolor='#777777'))

            # Add the feature names offset around the axis marker
            if xy[0] < 0.0 and xy[1] < 0.0:
                self.ax.text(xy[0] - 0.025, xy[1] - 0.025, name, ha='right', va='top', size='small')
            elif xy[0] < 0.0 and xy[1] >= 0.0:
                self.ax.text(xy[0] - 0.025, xy[1] + 0.025, name, ha='right', va='bottom', size='small')
            elif xy[0] >= 0.0 and xy[1] < 0.0:
                self.ax.text(xy[0] + 0.025, xy[1] - 0.025, name, ha='left', va='top', size='small')
            elif xy[0] >= 0.0 and xy[1] >= 0.0:
                self.ax.text(xy[0] + 0.025, xy[1] + 0.025, name, ha='left', va='bottom', size='small')

        self.ax.axis('equal')
813280
def plot(self, x, y, color="black"):
        
        p = Point(x, y)
        p.fill(color)
        p.draw(self)
362491
def get_plot(self_or_cls, obj, doc=None, renderer=None, **kwargs):
        
        if doc is None:
            doc = Document() if self_or_cls.notebook_context else curdoc()

        if self_or_cls.notebook_context:
            curdoc().theme = self_or_cls.theme
        doc.theme = self_or_cls.theme
        plot = super(BokehRenderer, self_or_cls).get_plot(obj, renderer, **kwargs)
        plot.document = doc
        return plot
1033313
function moveTerminator() { // if terminator line plotted move it every minute
    if (layers["_daynight"].getLayers().length > 0) {
        layers["_daynight"].clearLayers();
        layers["_daynight"].addLayer(L.terminator());
    }
}
258799
def plotline(plt, alpha, taus, style,label=""):
    
    y = [pow(tt, alpha) for tt in taus]
    plt.loglog(taus, y, style,label=label)