# Multilple plots on the same gragh

**URL:** <https://discourse.julialang.org/t/multilple-plots-on-the-same-gragh/37040>\
**Category:** Visualization\
**Created:** [April 4, 2020, 9:26pm UTC](https://discourse.julialang.org/t/multilple-plots-on-the-same-gragh/37040 "2020-04-04T21:26:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![brett\_knoss](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/brett_knoss/32/13050_2.png) [@brett\_knoss](https://discourse.julialang.org/u/brett_knoss)\
**Post date:** [April 4, 2020, 9:26pm UTC](https://discourse.julialang.org/t/multilple-plots-on-the-same-gragh/37040/1 "2020-04-04T21:26:35Z")

</div>

I’m able to graph two functions with plots

```julia
using Plots

U(E,W)= (40-E)^2/sqrt(W) #Utility function
E = 0:40
W = 10:100
UC=contour(E,W,U)

B(E,W)= -(40-E)/W # budget line function
E = 0:40
BL=contour(E,W,B)

```

How would I get these on the same plot, so that I can manipulate them?

---

<div class="post-metadata">

**Author:** ![kmundnic](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@kmundnic](https://discourse.julialang.org/u/kmundnic)\
**Post date:** [April 5, 2020, 12:13am UTC](https://discourse.julialang.org/t/multilple-plots-on-the-same-gragh/37040/2 "2020-04-05T00:13:11Z")

</div>

In general, you would use `!` to add to any plot, such as:

```julia
plot(1:3)
plot!(3:5)

```

For example, using `contour` (and borrowing code from the documentation),

```julia
x = y = range(-20, 20, length = 100)
contour(x, y, (x, y) -> x^2 + y^2)
contour!(x, y, (x, y) -> x + y)

```

gets you this plot:

 ![Screenshot 2020-04-04 17.01.04](https://global.discourse-cdn.com/julialang/original/3X/5/f/5fac2a491879177c6e005d7b14eed8afa8dfaa83.png)

It seems that in your example, your scales are too different for both plots to be seen in the same figure (the range of z in the first is [0, 500], the range of z in the second is [-4, 0]).

---

<div class="post-metadata">

**Author:** ![brett\_knoss](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/brett_knoss/32/13050_2.png) [@brett\_knoss](https://discourse.julialang.org/u/brett_knoss)\
**Post date:** [April 5, 2020, 1:15am UTC](https://discourse.julialang.org/t/multilple-plots-on-the-same-gragh/37040/3 "2020-04-05T01:15:16Z")

</div>

OK, I thought I had the formula wrong. BL is supposed to be lines that pivot from E=40, at W=0 to E=0, W=E\*W
