Skip to content
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified doc/_static/home/large_data.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 7 additions & 6 deletions doc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,10 +263,11 @@ align: center
:::{tab-item} Layout
```python
import hvplot.pandas
from hvplot.sample_data import us_crime as df
from hvplot.sampledata import stocks

plot1 = df.hvplot(x='Year', y='Violent Crime rate', width=400)
plot2 = df.hvplot(x='Year', y='Burglary rate', width=400)
df = stocks('pandas')
plot1 = df.hvplot(x='date', y='Apple', width=400)
plot2 = df.hvplot(x='date', y='Google', width=400)
plot1 + plot2
```
```{image} ./_static/home/layout.gif
Comment thread
Azaya89 marked this conversation as resolved.
Outdated
Expand Down Expand Up @@ -312,10 +313,10 @@ align: center
:::{tab-item} Large Data
```python
import hvplot.pandas
from hvplot.sample_data import catalogue as cat
from hvplot.sampledata import synthetic_clusters

df = cat.airline_flights.read()
df.hvplot.scatter(x='distance', y='airtime', rasterize=True, cnorm='eq_hist', width=500)
df = synthetic_clusters('pandas')
df.hvplot.points(datashade=True, by='cat', width=500)
```
```{image} ./_static/home/large_data.gif
---
Expand Down
146 changes: 76 additions & 70 deletions doc/user_guide/Plotting.ipynb

Large diffs are not rendered by default.

34 changes: 18 additions & 16 deletions doc/user_guide/Plotting_Extensions.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
"metadata": {},
"outputs": [],
"source": [
"from hvplot.sample_data import us_crime"
"from hvplot.sampledata import apple_stocks\n",
"\n",
"df = apple_stocks('pandas')"
]
},
{
Expand Down Expand Up @@ -57,7 +59,7 @@
"metadata": {},
"outputs": [],
"source": [
"us_crime.hvplot(x='Year', y='Violent Crime rate')"
"df.hvplot(x='date', y='close')"
]
},
{
Expand All @@ -79,7 +81,7 @@
"source": [
"hvplot.output(backend='plotly')\n",
"\n",
"us_crime.hvplot(x='Year', y='Violent Crime rate')"
"df.hvplot(x='date', y='close')"
]
},
{
Expand Down Expand Up @@ -110,7 +112,7 @@
"outputs": [],
"source": [
"hvplot.output(backend='bokeh')\n",
"us_crime.hvplot(x='Year', y='Violent Crime rate', line_dash='dashed')"
"df.hvplot(x='date', y='close', line_dash='dashed')"
]
},
{
Expand All @@ -121,7 +123,7 @@
"outputs": [],
"source": [
"hvplot.output(backend='matplotlib')\n",
"us_crime.hvplot(x='Year', y='Violent Crime rate', linestyle='dashed')"
"df.hvplot(x='date', y='close', linestyle='dashed')"
]
},
{
Expand All @@ -140,8 +142,8 @@
"outputs": [],
"source": [
"hvplot.extension('matplotlib', compatibility='bokeh')\n",
"violent_crime = us_crime.hvplot(x='Year', y='Violent Crime rate', line_dash='dashed')\n",
"violent_crime"
"stocks_plot = df.hvplot(x='date', y='close', line_dash='dashed')\n",
"stocks_plot"
]
},
{
Expand All @@ -151,7 +153,7 @@
"metadata": {},
"outputs": [],
"source": [
"violent_crime.opts.info()"
"stocks_plot.opts.info()"
]
},
{
Expand All @@ -175,7 +177,7 @@
"id": "706832e4",
"metadata": {},
"source": [
"In some cases it can be convenient to construct a plot with hvPlot and then get a handle on the figure object of the underlying plotting library to further customize the plot or to embed it in some more complex application. The `render` function allows to get a handle on the figure object. The following examples show that it's possible to use the API of Bokeh, Matplotlib or Plotly to update the title of the `violent_crime` plot."
"In some cases it can be convenient to construct a plot with hvPlot and then get a handle on the figure object of the underlying plotting library to further customize the plot or to embed it in some more complex application. The `render` function allows to get a handle on the figure object. The following examples show that it's possible to use the API of Bokeh, Matplotlib or Plotly to update the title of the `stocks_plot` plot."
]
},
{
Expand All @@ -185,7 +187,7 @@
"metadata": {},
"outputs": [],
"source": [
"violent_crime = us_crime.hvplot(x='Year', y='Violent Crime rate')"
"stocks_plot = df.hvplot(x='date', y='close')"
]
},
{
Expand All @@ -197,8 +199,8 @@
"source": [
"from bokeh.io import show\n",
"\n",
"bk_fig = hvplot.render(violent_crime, backend='bokeh')\n",
"bk_fig.title = 'Violent crime'\n",
"bk_fig = hvplot.render(stocks_plot, backend='bokeh')\n",
"bk_fig.title = 'Apple stocks'\n",
"show(bk_fig)"
]
},
Expand All @@ -210,9 +212,9 @@
"outputs": [],
"source": [
"%matplotlib inline\n",
"mpl_fig = hvplot.render(violent_crime, backend='matplotlib')\n",
"mpl_fig = hvplot.render(stocks_plot, backend='matplotlib')\n",
"axes = mpl_fig.get_axes()\n",
"axes[0].set_title('Violent crime')\n",
"axes[0].set_title('Apple stocks')\n",
"mpl_fig"
]
},
Expand All @@ -225,8 +227,8 @@
"source": [
"from plotly.graph_objects import Figure\n",
"\n",
"plotly_fig = hvplot.render(violent_crime, backend='plotly')\n",
"fig = Figure(plotly_fig).update_layout(title='Violent crime')\n",
"plotly_fig = hvplot.render(stocks_plot, backend='plotly')\n",
"fig = Figure(plotly_fig).update_layout(title='Apple stocks')\n",
"fig"
]
},
Expand Down
Loading
Loading