# Gaston to plot Cobb Douglas, not sure how to set scale

**URL:** <https://discourse.julialang.org/t/gaston-to-plot-cobb-douglas-not-sure-how-to-set-scale/37369>\
**Category:** Visualization\
**Created:** [April 10, 2020, 8:38pm UTC](https://discourse.julialang.org/t/gaston-to-plot-cobb-douglas-not-sure-how-to-set-scale/37369 "2020-04-10T20:38:05Z")\
**Posts on this page:** 4\
**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 10, 2020, 8:38pm UTC](https://discourse.julialang.org/t/gaston-to-plot-cobb-douglas-not-sure-how-to-set-scale/37369/1 "2020-04-10T20:38:05Z")

</div>

![](https://global.discourse-cdn.com/julialang/original/3X/0/9/094d30ee76ed41749d6eb7523bda304a697d4293.png)

I’m trying to model the above function

```julia
L= 0:600
K=0:600
Q=0:8000
surf(L, K, (L,K)->.1*K^.5*L^1.5,
    title="Cobb Douglas",
    plotstyle="lines", linecolor="magenta", gpcom="unset colorbox")
surf!(x,y,(x,y)->cos.(x/2).*sin.(y/2)+3,plotstyle="pm3d")

```

how do I get 0,0 closest to the viewer, instead of to the left?  
plotstyle=“lines”, linecolor=“magenta”, gpcom=“unset colorbox”)

```julia

When I do this I get an XML error in the graph dispaly

This XML file does not have any style information associated with it.
```

---

<div class="post-metadata">

**Author:** ![mbaz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mbaz/32/17295_2.png) [@mbaz](https://discourse.julialang.org/u/mbaz)\
**Post date:** [April 10, 2020, 10:21pm UTC](https://discourse.julialang.org/t/gaston-to-plot-cobb-douglas-not-sure-how-to-set-scale/37369/2 "2020-04-10T22:21:48Z")

</div>

You can control the viewing angle with `set view`. Assuming you want the point `K=0,L=0` closest to the viewer, you can achieve that with

```julia
julia> surf(L, K, (L,K)->.1*K^.5*L^1.5,
           title="Cobb Douglas",
           plotstyle="pm3d",
           xlabel="L", ylabel="K",
           gpcom="unset colorbox; set view 60,315")

```

which produces this:  
 ![image](https://global.discourse-cdn.com/julialang/original/3X/c/d/cd532424c70976056c276ff603c3bde5d02a00a8.png)

---

<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 11, 2020, 5:14pm UTC](https://discourse.julialang.org/t/gaston-to-plot-cobb-douglas-not-sure-how-to-set-scale/37369/3 "2020-04-11T17:14:12Z")

</div>

Thanks, looks great! Do you know how to increment numbers in 0:600 so it goes up by larger increments, and uses less CPU power?

---

<div class="post-metadata">

**Author:** ![pdeffebach](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pdeffebach/32/10320_2.png) [@pdeffebach](https://discourse.julialang.org/u/pdeffebach)\
**Post date:** [April 11, 2020, 5:16pm UTC](https://discourse.julialang.org/t/gaston-to-plot-cobb-douglas-not-sure-how-to-set-scale/37369/4 "2020-04-11T17:16:41Z")

</div>

See the docs for `range`

```julia
help?> range
search: range nzrange LinRange UnitRange StepRange StepRangeLen UnitRangeTransform trailing_zeros AbstractRange trailing_ones OrdinalRange

  range(start[, stop]; length, stop, step=1)

  Given a starting value, construct a range either by length or from start to stop, optionally with a given step (defaults to 1, a UnitRange). One
  of length or stop is required. If length, stop, and step are all specified, they must agree.

  If length and stop are provided and step is not, the step size will be computed automatically such that there are length linearly spaced elements
  in the range (a LinRange).

  If step and stop are provided and length is not, the overall range length will be computed automatically such that the elements are step spaced (a
  StepRange).

  stop may be specified as either a positional or keyword argument.

  │ Julia 1.1
  │
  │ stop as a positional argument requires at least Julia 1.1.

  Examples
  ≡≡≡≡≡≡≡≡≡≡

  julia> range(1, length=100)
  1:100
  
  julia> range(1, stop=100)
  1:100
  
  julia> range(1, step=5, length=100)
  1:5:496
  
  julia> range(1, step=5, stop=100)
  1:5:96
  
  julia> range(1, 10, length=101)
  1.0:0.09:10.0
  
  julia> range(1, 100, step=5)
  1:5:96

```

You would probably want

```julia
julia> range(0, 600, length = 100)
0.0:6.0606060606060606:600.0

```
