holoviz / hvplot

A high-level plotting API for pandas, dask, xarray, and networkx built on HoloViews
https://hvplot.holoviz.org
BSD 3-Clause "New" or "Revised" License
1.09k stars 105 forks source link

Add `subcoordinate_y` keyword #1379

Closed maximlt closed 1 month ago

maximlt commented 2 months ago

Closes https://github.com/holoviz/hvplot/issues/1160

import hvplot.pandas  # noqa
from bokeh.sampledata.sea_surface_temperature import sea_surface_temperature as sst

new_cols = {f'temperature{i}': sst.temperature.shift(i*1000) for i in range(1, 4)}
sst.assign(**new_cols).hvplot(subcoordinate_y=True, legend=False)

image

codecov[bot] commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 88.89%. Comparing base (feffee5) to head (6316666).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1379 +/- ## ========================================== + Coverage 88.87% 88.89% +0.02% ========================================== Files 51 51 Lines 7478 7494 +16 ========================================== + Hits 6646 6662 +16 Misses 832 832 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

droumis commented 1 month ago

Looks pretty good!

Code ```python import numpy as np import pandas as pd from pathlib import Path import mne import colorcet as cc from hvplot import pandas hv.extension('bokeh') # data from https://datasets.holoviz.org/eeg/v1/S001R04.edf data_path = raw = mne.io.read_raw_edf(data_path, preload=True) raw.set_eeg_reference("average") raw.rename_channels(lambda s: s.strip(".")); df = raw.to_data_frame() df.set_index('time', inplace=True) df.hvplot(subcoordinate_y={'subcoordinate_scale':4}, responsive=True, min_height=700, legend=False, color='black', line_width=1) ```

image

Known issues:

Nice to haves eventually: