I want to use the default title that is dynamically updated along with the controls generated for the groupby option in an hvplot, but want to be able to set the wrapping width of the title to something longer (or even better have it match the plot width). Is there a way to do that?
Eg,
df.hvplot.violin(
y="solution_cost",
by="solver",
color="solver",
aspect=2.5,
grid=True,
legend=False,
groupby=["heuristic", "min_best_path", "moves_per_iter", "add_noise", "round"],
)
Theoretically it should be able to do so already
from bokeh.sampledata.sprint import sprint as df
import hvplot.pandas
df.hvplot.violin(y="Time", by="Medal", groupby="Year").opts(title="ABC DEF GHI ABC DEF GHIABC DEF GHI ABC DEF GHIABC DEF GHIABC DEF GHI ABC DEF GHIABC DEF GHIABC DEF GHIABC DEF GHI", width=800, height=400)
Seems like something is hardcoded to create new line every two dims.
from bokeh.sampledata.sprint import sprint as df
import hvplot.pandas
df.hvplot.violin(y="Time", by="Medal", groupby=["Medal", "Year", "Country"])
Can you file an issue on hvplot (or maybe HoloViews)?
Indeed, it is hardcoded here:
# Assumes composite objects are iterables
if hasattr(self, 'subplots') and self.subplots:
for el in self.subplots.values():
if el is None:
continue
accumulator += el.traverse(fn, specs, full_breadth)
if not full_breadth: break
return accumulator
def _frame_title(self, key, group_size=2, separator='\n'):
"""Returns the formatted dimension group strings
for a particular frame.
"""
if self.layout_dimensions is not None:
dimensions, key = zip(*self.layout_dimensions.items())
elif not self.dynamic and (not self.uniform or len(self) == 1) or self.subplot:
return ''
else:
key = key if isinstance(key, tuple) else (key,)
so it appears to be a holoviews issue.
Thanks for tracking it down and creating an issue!