.opts(norm=...) warnings

Hi,

I’m a bit lost and cannot find anything in the docs. The only example in the docs addressing the norm= options has also warnings. Having a lot of subplots (>20), I don’t want warnings pollute my output. Any help appreciated.

To ask a bit differently - is it possible to get independend axis without warnings?
Using df.plot().opts(norm={'axiswise': True}) produces warnings about using .options. But using the same argument with .options produces an error.

import holoviews


plots = []

for i in range(10):
  plots.append(df.plot().opts(norm={'axiswise': True}))
  #   plots.append(df.plot().options(norm={'axiswise': True}))  # raises an exception
  #   plots.append(df.plot().options(normalize=False))  # does apparently sth else

holoviews.Layout(plots)  # a lot of warnings
WARNING:param.main: Calling the .opts method with options broken down by options group (i.e. separate plot, style and norm groups) is deprecated. Use the .options method converting to the simplified format instead or use hv.opts.apply_groups for backward compatibility.
WARNING:param.main: Calling the .opts method with options broken down by options group (i.e. separate plot, style and norm groups) is deprecated. Use the .options method converting to the simplified format instead or use hv.opts.apply_groups for backward compatibility.
WARNING:param.main: Calling the .opts method with options broken down by options group (i.e. separate plot, style and norm groups) is deprecated. Use the .options method converting to the simplified format instead or use hv.opts.apply_groups for backward compatibility.
WARNING:param.main: Calling the .opts method with options broken down by options group (i.e. separate plot, style and norm groups) is deprecated. Use the .options method converting to the simplified format instead or use hv.opts.apply_groups for backward compatibility.
WARNING:param.main: Calling the .opts method with options broken down by options group (i.e. separate plot, style and norm groups) is deprecated. Use the .options method converting to the simplified format instead or use hv.opts.apply_groups for backward compatibility.
WARNING:param.main: Calling the .opts method with options broken down by options group (i.e. separate plot, style and norm groups) is deprecated. Use the .options method converting to the simplified format instead or use hv.opts.apply_groups for backward compatibility.
WARNING:param.main: Calling the .opts method with options broken down by options group (i.e. separate plot, style and norm groups) is deprecated. Use the .options method converting to the simplified format instead or use hv.opts.apply_groups for backward compatibility.
WARNING:param.main: Calling the .opts method with options broken down by options group (i.e. separate plot, style and norm groups) is deprecated. Use the .options method converting to the simplified format instead or use hv.opts.apply_groups for backward compatibility.
WARNING:param.main: Calling the .opts method with options broken down by options group (i.e. separate plot, style and norm groups) is deprecated. Use the .options method converting to the simplified format instead or use hv.opts.apply_groups for backward compatibility.
WARNING:param.main: Calling the .opts method with options broken down by options group (i.e. separate plot, style and norm groups) is deprecated. Use the .options method converting to the simplified format instead or use hv.opts.apply_groups for backward compatibility.

It should be as simple as .opts(axiswise=True)

@Hoxbro works, thanks! Hope some day it will be an example also in the docs. Anyway, I owe you a beer or two.

Hm… seems to only work if the data frame has 1 column. Any ideas why it doesn’t work for df[selected_columns_list].plot().options(axiswise=True)?

Can you share a minimal, reproducible example (MRE)?

In this example both plots go [0, 100], but first should go [0, 8], and second [100, 107].

import pandas
import holoviews

df = pandas.DataFrame({"a": [1,2,3,4], "b": [5,6,7,8], "c": [100,101, 102, 103], "d": [104, 105, 106, 107]})
holoviews.Layout([df[["a", "b"]].plot().options(axiswise=True), df[["c", "d"]].plot().options(axiswise=True)])

It’s very strange - works as expected if ... df["a", "b"] .... df[["c"]] ... and ... df["a"] ... df[["c", "d"]] .... But if we have both [“a”, “b”] and [“c”, “d”] it stops working for some reason - both plot go [0, 108].

Could not get it to work with axiswise=True. But this will do it:

import pandas
import holoviews

pandas.options.plotting.backend = "holoviews"

df = pandas.DataFrame({"a": [1,2,3,4], "b": [5,6,7,8], "c": [100,101, 102, 103], "d": [104, 105, 106, 107]})
p1 = df[["a", "b"]].plot()
p2 = df[["c", "d"]].plot()
(p1 + p2).opts(shared_axes=False)

I have removed Holoviews.Layout by just adding the plots together.

I’m using holoviews.Layout only because I’m creating a lot of plots in a `for˙ loop and saving them to a list. Is there another way I can emulate adding of the plots together?

Nah it is fine to use hv.Layout just wanted to point it out. :slight_smile:

holoviews.Layout([plots]).options(shared_axes=False) works like a charm, thank you again!

1 Like