# Adding glyphs through hooks

**URL:** <https://discourse.holoviz.org/t/adding-glyphs-through-hooks/4457>\
**Category:** HoloViews\
**Tags:** panel, holoviews, hvplot\
**Created:** [October 25, 2022, 7:48pm UTC](https://discourse.holoviz.org/t/adding-glyphs-through-hooks/4457 "2022-10-25T19:48:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![LorenzoP](https://discourse.holoviz.org/user_avatar/discourse.holoviz.org/lorenzop/32/4142_2.png) [@LorenzoP](https://discourse.holoviz.org/u/LorenzoP)\
**Post date:** [October 25, 2022, 7:48pm UTC](https://discourse.holoviz.org/t/adding-glyphs-through-hooks/4457/1 "2022-10-25T19:48:15Z")

</div>

Hello,

I am trying to use a hook to add more lines based on another variable. The `add_glyph` seems to work correctly as I get 2 renderers. However, they are not shown in the plot.

How can I make it visible?

```auto
import holoviews as hv
from holoviews import opts, streams
from bokeh.models import Line, ColumnDataSource
hv.extension("bokeh")
def add_time_series(plot, element):

    source = ColumnDataSource(dict(x=[1,2,3,4], y=[5,5,5,5]))
    line = Line(x="date", y="y")
    plot.state.add_glyph(source, line)
    
    assert len(plot.state.renderers) == 2

hv.Curve([1,1,1,1]).opts(hooks=[add_time_series], framewise=True)

```

---

<div class="post-metadata">

**Author:** ![Hoxbro](https://discourse.holoviz.org/user_avatar/discourse.holoviz.org/hoxbro/32/3590_2.png) [@Hoxbro](https://discourse.holoviz.org/u/Hoxbro)\
**Post date:** [October 26, 2022, 8:03am UTC](https://discourse.holoviz.org/t/adding-glyphs-through-hooks/4457/2 "2022-10-26T08:03:20Z")

</div>

Why don’t you combine two curves?

`hv.Curve([1,1,1,1]) * hv.Curve(([1,2,3,4], [5,5,5,5])) `

![image](https://discourse.holoviz.org/uploads/default/original/2X/6/6fbe4433c78f97784674a9ec8fce1096d5866945.png)

---

<div class="post-metadata">

**Author:** ![LorenzoP](https://discourse.holoviz.org/user_avatar/discourse.holoviz.org/lorenzop/32/4142_2.png) [@LorenzoP](https://discourse.holoviz.org/u/LorenzoP)\
**Post date:** [October 26, 2022, 3:17pm UTC](https://discourse.holoviz.org/t/adding-glyphs-through-hooks/4457/3 "2022-10-26T15:17:00Z")

</div>

So this is in the context of a broader task. We are using datashader and we have a tile map and a Dynamic Map that controls the stream. There seems to be an issue when combining the three as I posted here [Tap Selection](https://discourse.holoviz.org/t/dynamic-map-with-tapselection/4426).

Doing what you suggested would give me an hv.Overlay.

What I am hoping to do is add to a plot using `hook` as a workaround? Is that possible? As stated above, it seems to work as they are added to the figure but they are not shown.
