Gary
Gary

Reputation: 103

Remove Letter Labels on Holoviews Figures with Matplotlib Backend

When I create a Holoviews figure of two or more plots with a Matplotlib backend, I get each figure labeled with a letter (A, B, etc). For example:

import numpy as np
import holoviews as hv
hv.extension('matplotlib')

test = hv.Points(np.random.random(20).reshape(-1, 2)) + \
    hv.Points(np.random.random(20).reshape(-1, 2))

test

(My low reputation won't let me post an image of the output here, but here's another example from the Holoviews Documentation.)

I imagine the idea for these being here is more accurate labeling for static figures in published papers, but I don't need it for my use case. Given the styling looks a lot like it would in pure Matplotlib, I imagine this is a conscious choice hidden in source code, but I haven't been able to find it or figure out how to turn it off. Is there a way to toggle these letter labels on and off?

Upvotes: 3

Views: 331

Answers (1)

James A. Bednar
James A. Bednar

Reputation: 3255

Sure, just use the sublabel_format option:

import numpy as np
import holoviews as hv
hv.extension('matplotlib')

test = hv.Points(np.random.random(20).reshape(-1, 2)) + \
       hv.Points(np.random.random(20).reshape(-1, 2))

test.opts(sublabel_format="")

Or, if you want to turn it off for everything, you can add these lines to the top of your notebook or to your ~/.holoviews.rc file:

from holoviews.plotting.mpl import MPLPlot
MPLPlot.sublabel_format=""

Upvotes: 2

Related Questions