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

I’m trying to model the above function

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”)


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.

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> 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

2 Likes

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?

See the docs for range

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> range(0, 600, length = 100)
0.0:6.0606060606060606:600.0
3 Likes