tensor_methods

Tensor Methods for DS and SC
git clone git://popovic.xyz/tensor_methods.git
Log | Files | Refs

cs_plot.jl (764B)


      1 #/usr/bin/julia
      2 
      3 using LinearAlgebra
      4 using Plots
      5 using Maxvol
      6 using TSVD
      7 using LaTeXStrings
      8 
      9 function cs_plot(x, f, P_M_s, r, name)
     10     x_red = x[1:3:n];
     11     s = surface(x_red, x_red, f, colorbar=false);
     12     c = contour(x_red, x_red, f, colorbar=false);
     13     for (i, r_i) in enumerate(r)
     14         p = plot(s, c,
     15                  layout=(1, 2),
     16                  titlefontsize=10,
     17                  xlabelfontsize=7,
     18                  ylabelfontsize=5,
     19                  dpi=300,
     20                  title="$f(x, y) at r=$r_i",
     21                  size=(600, 300))
     22         hline!(p[1], [0], x[P_M_s[i]], color=:red, opacity=0.5, label="", lw=2)
     23         hline!(p[2], [0], x[P_M_s[i]], color=:red, opacity=0.5, label="", lw=2)
     24         savefig(p, "cs-$name-$r_i.png")
     25     end
     26 end