Python bokeh.layouts() Examples

The following are 4 code examples of bokeh.layouts(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module bokeh , or try the search function .
Example #1
Source File: geoplot.py    From Pandas-Bokeh with MIT License 5 votes vote down vote up
def _get_figure(col):
    """Gets the bokeh.plotting.figure from a bokeh.layouts.column."""

    from bokeh.layouts import column
    from bokeh.plotting import figure

    for children in col.children:
        if isinstance(children, type(figure())):
            return children
        elif isinstance(children, type(column())):
            return _get_figure(children) 
Example #2
Source File: plot.py    From Pandas-Bokeh with MIT License 4 votes vote down vote up
def line(self, x=None, y=None, **kwargs):
        """
        Plot DataFrame columns as lines.

        This function is useful to plot lines using DataFrame's values
        as coordinates.

        Parameters
        ----------
        x : int or str, optional
            Columns to use for the horizontal axis.
            Either the location or the label of the columns to be used.
            By default, it will use the DataFrame indices.
        y : int, str, or list of them, optional
            The values to be plotted.
            Either the location or the label of the columns to be used.
            By default, it will use the remaining DataFrame numeric columns.
        **kwds
            Keyword arguments to pass on to :meth:`pandas.DataFrame.plot_bokeh`.

        Returns
        -------
        
        Bokeh.plotting.figure or Bokeh.layouts.row

        Examples
        --------

        .. plot::
            :context: close-figs

            The following example shows the populations for some animals
            over the years.

            >>> df = pd.DataFrame({
            ...    'pig': [20, 18, 489, 675, 1776],
            ...    'horse': [4, 25, 281, 600, 1900]
            ...    }, index=[1990, 1997, 2003, 2009, 2014])
            >>> lines = df.plot_bokeh.line()


        .. plot::
            :context: close-figs

            The following example shows the relationship between both
            populations.

            >>> lines = df.plot_bokeh.line(x='pig', y='horse')
        """
        return self(kind="line", x=x, y=y, **kwargs) 
Example #3
Source File: plot.py    From Pandas-Bokeh with MIT License 4 votes vote down vote up
def step(self, x=None, y=None, **kwargs):
        """
        Plot DataFrame columns as step lines.

        This function is useful to plot step lines using DataFrame's values
        as coordinates.

        Parameters
        ----------
        x : int or str, optional
            Columns to use for the horizontal axis.
            Either the location or the label of the columns to be used.
            By default, it will use the DataFrame indices.
        y : int, str, or list of them, optional
            The values to be plotted.
            Either the location or the label of the columns to be used.
            By default, it will use the remaining DataFrame numeric columns.
        **kwds
            Keyword arguments to pass on to :meth:`pandas.DataFrame.plot_bokeh`.

        Returns
        -------
        
        Bokeh.plotting.figure or Bokeh.layouts.row

        Examples
        --------

        .. plot::
            :context: close-figs

            The following example shows the populations for some animals
            over the years.

            >>> df = pd.DataFrame({
            ...    'pig': [20, 18, 489, 675, 1776],
            ...    'horse': [4, 25, 281, 600, 1900]
            ...    }, index=[1990, 1997, 2003, 2009, 2014])
            >>> steps = df.plot_bokeh.step()


        .. plot::
            :context: close-figs

            The following example shows the relationship between both
            populations.

            >>> steps = df.plot_bokeh.step(x='pig', y='horse')
        """
        return self(kind="step", x=x, y=y, **kwargs) 
Example #4
Source File: plot.py    From Pandas-Bokeh with MIT License 4 votes vote down vote up
def point(self, x=None, y=None, **kwargs):
        """
        Plot DataFrame columns as points.

        This function is useful to plot lines using DataFrame's values
        as coordinates.

        Parameters
        ----------
        x : int or str, optional
            Columns to use for the horizontal axis.
            Either the location or the label of the columns to be used.
            By default, it will use the DataFrame indices.
        y : int, str, or list of them, optional
            The values to be plotted.
            Either the location or the label of the columns to be used.
            By default, it will use the remaining DataFrame numeric columns.
        **kwds
            Keyword arguments to pass on to :meth:`pandas.DataFrame.plot_bokeh`.

        Returns
        -------
        
        Bokeh.plotting.figure or Bokeh.layouts.row

        Examples
        --------

        .. plot::
            :context: close-figs

            The following example shows the populations for some animals
            over the years.

            >>> df = pd.DataFrame({
            ...    'pig': [20, 18, 489, 675, 1776],
            ...    'horse': [4, 25, 281, 600, 1900]
            ...    }, index=[1990, 1997, 2003, 2009, 2014])
            >>> lines = df.plot_bokeh.point()


        .. plot::
            :context: close-figs

            The following example shows the relationship between both
            populations.

            >>> lines = df.plot_bokeh.point(x='pig', y='horse')
        """
        return self(kind="point", x=x, y=y, **kwargs)