def sentiment_scatter(sms=sms):
    plt.figure(figsize=(10, 7.5))
    ax = plt.subplot(1, 1, 1)
    ax = sms.plot.scatter(x='topic4', y='line', ax=ax, color='g', marker='+', alpha=.6)
    ax = sms.plot.scatter(x='topic4', y='sgd', ax=ax, color='r', marker='x', alpha=.4)
    ax = sms.plot.scatter(x='topic4', y='vader', ax=ax, color='k', marker='.', alpha=.3)
    ax = sms.plot.scatter(x='topic4', y='sgd', ax=ax, color='c', marker='s', alpha=.6)
    ax = sms.plot.scatter(x='topic4', y='pca_lda_spaminess', ax=ax, color='b', marker='o', alpha=.6)
    plt.ylabel('Sentiment')
    plt.xlabel('Topic 4')
    plt.legend(['LinearRegressor', 'SGDRegressor', 'Vader', 'OneNeuronRegresor', 'PCA->LDA->spaminess'])
    plt.tight_layout()
    plt.show()
Similar code snippets
1.
Match rating: 84.41% · See similar code snippets
python logo
def sentiment_scatter(sms=sms):
    sms = sms.sort_values('topic4').sample(200)
    plt.figure(figsize=(10, 7.5))
    ax = plt.subplot(1, 1, 1)
    ax = sms.plot.scatter(x='topic4', y='line', ax=ax, color='g',   marker='+', s=400, lw=3, alpha=.5)
    ax = sms.plot.scatter(x='topic4', y='sgd', ax=ax, color='r',    marker='x', s=200, lw=3, alpha=.5)
    ax = sms.plot.scatter(x='topic4', y='vader', ax=ax, color='k',  marker='s', s=100, alpha=.5)
    ax = sms.plot.scatter(x='topic4', y='neuron', ax=ax, color='c', marker='.', s=100, alpha=.5)
    ax = sms.plot.scatter(x='topic4', y='pca_lda_spam_prob', ax=ax, marker='o', s=150, color='b', alpha=.5)
    plt.ylabel('Sentiment')
    plt.xlabel('Topic 4')
    plt.legend(['LinearRegressor', 'SGDRegressor', 'VADER', 'OneNeuronRegresor', 'PCA->LDA->spaminess'])
    plt.tight_layout()
    plt.grid()
    plt.show()
2.
perimosocordiae/viztricks · convenience.py
Match rating: 57.99% · See similar code snippets
python logo
def plot(X, marker='.', kind='plot', title=None, fig='current', ax=None,
         **kwargs):
  '''General plotting function that aims to cover most common cases.
  X : numpy array of 1d, 2d, or 3d points, with one point per row.
  marker : passed to the underlying plotting function
  kind : one of {plot, scatter} that controls the plot type.
  title : if given, used as the axis title
  fig : a matplotlib.Figure, or one of {current, new}. Only used when ax=None.
  ax : a matplotlib.Axes object, or None
  All other keyword arguments are passed on to the underlying plotting function.
  '''
  X = np.asanyarray(X)
  if X.ndim not in (1,2) or (X.ndim == 2 and X.shape[1] not in (1,2,3)):
    raise ValueError('Input data must be rows of 1, 2, or 3 dimensional points')
  is_3d = X.ndim == 2 and X.shape[1] == 3
  is_1d = X.ndim == 1 or X.shape[1] == 1
  ax = _get_axis(fig, ax, is_3d)
  # XXX: support old-style scatter=True kwarg usage
  if kwargs.get('scatter', False):
    kind = 'scatter'
    del kwargs['scatter']
  # Do the plotting
  if kind is 'scatter':
    if is_1d:
      ax.scatter(np.arange(len(X)), X, marker=marker, **kwargs)
    elif is_3d:
      ax.scatter(X[:,0], X[:,1], X[:,2], marker=marker, **kwargs)
    else:
      ax.scatter(X[:,0], X[:,1], marker=marker, **kwargs)
  elif kind is 'plot':
    if is_1d:
      ax.plot(X, marker, **kwargs)
    elif is_3d:
      ax.plot(X[:,0], X[:,1], X[:,2], marker, **kwargs)
    else:
      ax.plot(X[:,0], X[:,1], marker, **kwargs)
  else:
    raise ValueError('Unsupported kind: %r' % kind)
  if title:
    ax.set_title(title)
  return plt.show
3.
perimosocordiae/data_explorer · plot_utils.py
Match rating: 56.38% · See similar code snippets
python logo
def _make_plot_func(ax, marker, color, cmap):
  if color is not None:
    kwargs = dict(c=color, cmap=cmap)
    if marker is not None:
      kwargs['marker'] = marker
    return lambda *args: ax.scatter(*args, **kwargs)
  if marker is not None:
    return lambda *args, **kwargs: ax.plot(*(args + (marker,)), **kwargs)
  return ax.plot
4.
marcharper/python-ternary · ternary_axes_subplot.py
Match rating: 55.82% · See similar code snippets
python logo
def scatter(self, points, **kwargs):
        ax = self.get_axes()
        permutation = self._permutation
        plot_ = plotting.scatter(points, ax=ax, permutation=permutation,
                                 **kwargs)
        return plot_
5.
flowersteam/explauto · tree.py
Match rating: 55.5% · See similar code snippets
python logo
def plot(self, ax, scatter=True, grid=True, progress_colors=True, progress_max=1., depth=10, plot_dims=[0,1]):
        """
        Plot a projection on 2D of the Tree.
        
        Parameters
        ----------
        ax : plt axis
        scatter : bool
            If the points are ploted
        grid : bool
            If the leaves' bounds are ploted
        progress_colors : bool
            If rectangles are filled with colors based on progress 
        progress_max : float
            Max progress on color scale (will be ploted as 1.)
        depth : int
            Max depth of the ploted nodes
        plot_dims : list
            List of the 2 dimensions to project tree on
        
        """
        
        if scatter and self.get_data_x() is not None:
            self.plot_scatter(ax, plot_dims)
            
        if grid:
            self.plot_grid(ax, progress_colors, progress_max, depth, plot_dims)
6.
rraadd88/rohan · schem.py
Match rating: 55.36% · See similar code snippets
python logo
def plot_fitland(xys,ns=None,widths=None,
                 params_cbar={},
                 fig=None,ax=None,
                 test=False):
    if fig is None:
        fig=plt.figure(figsize=[3,2.75])
    if ax is None:
        ax=plt.subplot()
    df=pd.DataFrame(columns=['x','y'])
    if ns is None:
        ns=[100 for i in xys]
    if widths is None:
        widths=[0.7 for i in xys]
    for center,n,width in zip(xys,ns,widths):
        df_=get_spray(n=n,center=center,width=width)
        df=df.append(df_)
    sns.kdeplot(df.x, df.y,
                     cmap="coolwarm", 
                shade=True, 
                shade_lowest=True,
                ax=ax,
                **params_cbar,
               )
    if test:
        ax=df.plot.scatter(x='x',y='y',ax=ax)        
    ax.set_xlim(0,1)
    ax.set_ylim(0,1)
    ax.set_xticks([])
    ax.set_yticks([])
    return ax
7.
flowersteam/explauto · tree.py
Match rating: 55.29% · See similar code snippets
python logo
def plot_scatter(self, ax, plot_dims=[0,1]):
        if np.shape(self.get_data_x())[0] <= 5000:
            ax.scatter(self.get_data_x()[:,plot_dims[0]], self.get_data_x()[:,plot_dims[1]], color = 'black')
8.
zkbt/the-friendly-stars · constellation.py
Match rating: 55.05% · See similar code snippets
python logo
def allskyfinder(self, figsize=(14, 7), **kwargs):
        '''
        Plot an all-sky finder chart. This *does* create a new figure.
        '''

        plt.figure(figsize=figsize)
        scatter = self.plot(**kwargs)
        plt.xlabel(r'Right Ascension ($^\circ$)'); plt.ylabel(r'Declination ($^\circ$)')
        #plt.title('{} in {:.1f}'.format(self.name, epoch))
        plt.xlim(0, 360)
        plt.ylim(-90,90)
        return scatter
9.
vaexio/vaex · layers.py
Match rating: 55.04% · See similar code snippets
python logo
def plot_scatter(self, axes_list):
        for ax in axes_list:
            # TODO: support multiple axes with the axis index
            x = self.dataset.evaluate(self.x)
            y = self.dataset.evaluate(self.y)
            ax.scatter(x, y, alpha=self.state.alpha, color=self.color)
            row = self.dataset.get_current_row()
            if row is not None:
                ax.scatter([x[row]], [y[row]], alpha=self.state.alpha, color=self.color_alt)
10.
EconForge/dolo · smolyak.py
Match rating: 54.98% · See similar code snippets
python logo
def plot_grid(self):
        import matplotlib.pyplot as plt
        grid = self.grid
        if grid.shape[1] == 2:
            xs = grid[:, 0]
            ys = grid[:, 1]
            fig = plt.figure()
            ax = fig.add_subplot(111)
            ax.scatter(xs, ys)
            ax.grid(True, linestyle='--',color='0.75')
            plt.show()
        elif grid.shape[1] == 3:
            from mpl_toolkits.mplot3d import Axes3D
            xs = grid[:, 0]
            ys = grid[:, 1]
            zs = grid[:, 2]
            fig = plt.figure()
            ax = fig.add_subplot(111, projection='3d')
            ax.scatter(xs, ys, zs)
            ax.grid(True, linestyle='--',color='0.75')
            plt.show()
        else:
            raise ValueError('Can only plot 2 or 3 dimensional problems')