Open droumis opened 9 months ago
@droumis I can see the project board that this is planned for Q4 of this year. Is this a hard deadline?
But my main question would be: is this feature not too niche to be exposed in hvPlot? Increasing hvPlot's API comes with a cost, it makes it more difficult for users to navigate through its many parameters. I'm not -1 on this, but I'd like to make sure this is discussed.
Whether or not the minimap should be included with the simple default API call is something that needs to be discussed and considered further.
Yes I wouldn't tie the "minimap" (or however we call it in the end) with subcoordinate_y
. We should open a separate issue to discuss how we'd generally like to expose the minimap in hvPlot.
If it's eventually implemented, I guess we could also support a DataFrame with a datetime index, using the column names as the source labels.
But my main question would be: is this feature not too niche to be exposed in hvPlot? Increasing hvPlot's API comes with a cost, it makes it more difficult for users to navigate through its many parameters. I'm not -1 on this, but I'd like to make sure this is discussed.
Personally, I feel like this is more of an issue on how our doc(strings) are organized than a general issue. subplot_y
can be quite a nice and general feature and if it isn't general enough to generate e.g. a joy plot then that should be improved at the HoloViews level.
@maximlt , I'm in the process of updating the project board (this week); Q4 is not a hard deadline for this task, I'm going to push it to later since we are also still working on tasks that would directly impact this implementation.
I agree with @philippjfr that a ridgeplot (aka joyplot) is a common enough type of plot to justify the inclusion burden for hvPlot. With subcoordinate_y
this is possible using Curve
, but Area
is more commonly used for a ridgeplot and it looks like it needs the element order to be reversed by default. I'll file an issue with HoloViews.
While we're at it, HoloViews should also support grabbing the label for each subcoordinate from the NdOverlay key. So it becomes as simple as this:
import numpy as np
import hvplot.pandas
from scipy.stats import gaussian_kde
categories = ['A', 'B', 'C', 'D', 'E']
data = {cat: np.random.normal(loc=i-2, scale=1.0, size=100) for i, cat in enumerate(categories)}
pd.DataFrame(data).hvplot.kde(y=categories, subcoordinate_y=True, subcoordinate_scale=1.5)
Right now you have to manually insert the labels explicitly:
import numpy as np
import hvplot.pandas
from scipy.stats import gaussian_kde
categories = ['A', 'B', 'C', 'D', 'E']
data = {cat: np.random.normal(loc=i-2, scale=1.0, size=100) for i, cat in enumerate(categories)}
labels = iter(categories)
overlay = pd.DataFrame(data).hvplot.kde(y=categories).map(lambda el: el.relabel(next(labels)), specs='Distribution')
overlay.opts('Distribution', subcoordinate_y=True, subcoordinate_scale=1.5)
subcoordinate_y
was recently added to HoloViews to plot on subcordinates. This should now be incorporated into hvPlot when working with xarray.The API could be something as simple as:
da.hvplot(subcoordinate_y=True)
.This would produce something like:![image](https://github.com/holoviz/hvplot/assets/6613202/c3ed956a-6de5-4068-a94b-a6abf395e5f4)
The minimum data are:
There should also be the option for adjusting
subcoordinate_scale
(as in HoloViews).Whether or not the minimap should be included with the simple default API call is something that needs to be discussed and considered further.