# How to avoid this code duplication?

**URL:** https://discourse.julialang.org/t/how-to-avoid-this-code-duplication/69171
**Category:** New to Julia
**Tags:** plotting, makie
**Created:** [October 4, 2021, 8:58am UTC](https://discourse.julialang.org/t/how-to-avoid-this-code-duplication/69171 "2021-10-04T08:58:46Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![Bardo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bardo/32/21601_2.png) [@Bardo](https://discourse.julialang.org/u/Bardo)
#### Post date: [October 4, 2021, 10:54am UTC](https://discourse.julialang.org/t/how-to-avoid-this-code-duplication/69171/2 "2021-10-04T10:54:21Z")

</div>

Solved using multiple dispatch, see [makie\_addsubplot](https://discourse.julialang.org/t/makie-multiline-plots-subplots-and-attributes-examples/69113).

---

_[View the full topic](https://discourse.julialang.org/t/how-to-avoid-this-code-duplication/69171)._
