@@ -78,8 +78,8 @@ using Distributions, VLBIImagePriors
7878prior = (
7979 radius = Uniform(μas2rad(10.0 ), μas2rad(30.0 )),
8080 width = Uniform(μas2rad(1.0 ), μas2rad(10.0 )),
81- ma = (Uniform(0.0 , 0.5 ), Uniform( 0.0 , 0.5 ) ),
82- mp = (Uniform(0 , 2 π), Uniform( 0 , 2 π) ),
81+ ma = (Uniform(0.0 , 0.5 ),),
82+ mp = (Uniform(0 , 2 π),),
8383 τ = Uniform(0.0 , 1.0 ),
8484 ξτ = Uniform(0.0 , π),
8585 f = Uniform(0.0 , 1.0 ),
@@ -119,8 +119,8 @@ logdensityof(
119119 sky = (
120120 radius = μas2rad(20.0 ),
121121 width = μas2rad(10.0 ),
122- ma = (0.3 , 0.3 ),
123- mp = (π / 2 , π ),
122+ ma = (0.3 ,),
123+ mp = (π / 2 ,),
124124 τ = 0.1 ,
125125 ξτ = π / 2 ,
126126 f = 0.6 ,
@@ -218,16 +218,14 @@ DisplayAs.Text(DisplayAs.PNG(fig))
218218# model is fitting the data we can plot the model and data products. As of Comrade 0.11.7 Makie
219219# is the preferred plotting tool. For plotting data there are two classes of functions
220220# - `baselineplot` which gives complete control of plotting
221- # - `plotfields, axisfields ` which are more automated and limited but will automatically add
221+ # - `plotfields, plotfields! ` which are more automated and limited but will automatically add
222222# labels, legends, titles etc.
223- # We will demonstrate both below.
223+ # A reasonable workflow is to use `plotfields` to set up the initial figure and axis labels and then
224+ # then use `baselineplot!` to add additional plots to the axis. For example,
224225lcsim, cpsim = simulate_observation(post, xopt; add_thermal_noise = false )
225- fig = Figure(; size = (800 , 300 ))
226- ax1 = Axis(fig[1 , 1 ], xlabel = " √Quadrangle Area" , ylabel = " Log Closure Amplitude" )
227- baselineplot!(ax1, lcsim, uvdist, measwnoise, marker = :circle, label = " MAP" , error = true )
228- baselineplot!(ax1, dlcamp, uvdist, Comrade. measurement, marker = :+ , color = :black, label = " Data" )
229- ax2 = Axis(fig[1 , 2 ], xlabel = " √Triangle Area" , ylabel = " Closure Phase" )
230- baselineplot!(ax2, cpsim, uvdist, mod2pi ∘ measwnoise, marker = :circle, label = " MAP" , error = true )
226+ fig, ax1 = plotfields(lcsim, uvdist, measwnoise, scatter_kwargs = (; marker = :circle, label = " MAP" ), figure_kwargs = (; size = (800 , 300 )), legend = false );
227+ baselineplot!(ax1, dlcamp, uvdist, measurement, marker = :+ , color = :black, label = " Data" )
228+ ax2, = plotfields!(fig[1 , 2 ], cpsim, uvdist, mod2pi ∘ measwnoise, scatter_kwargs = (; marker = :circle, label = " MAP" ), axis_kwargs = (ylabel = " Closure Phase (rad)" ,))
231229baselineplot!(ax2, dcphase, uvdist, mod2pi ∘ measurement, marker = :+ , color = :black, label = " Data" )
232230axislegend(ax1, framevisible = false )
233231DisplayAs. Text(DisplayAs. PNG(fig))
@@ -237,7 +235,7 @@ DisplayAs.Text(DisplayAs.PNG(fig))
237235# are marginalized over the posterior.
238236fig = Figure(; size = (800 , 300 ))
239237ax1 = Axis(fig[1 , 1 ], xlabel = " √Quadrangle Area" , ylabel = " Log Closure Amplitude" )
240- ax2 = Axis(fig[1 , 2 ], xlabel = " √Triangle Area" , ylabel = " Closure Phase" )
238+ ax2 = Axis(fig[1 , 2 ], xlabel = " √Triangle Area" , ylabel = " Closure Phase (rad) " )
241239for i in 1 : 10
242240 mobs = simulate_observation(post, sample(chain, 1 )[1 ])
243241 mlca = mobs[1 ]
@@ -254,7 +252,6 @@ DisplayAs.Text(DisplayAs.PNG(fig))
254252# The normalied residuals are the difference between the data
255253# and the model, divided by the data's error:
256254rd = residuals(post, chain[end ])
257- fig = Figure(; size = (800 , 300 ))
258- axisfields(fig[1 , 1 ], rd[1 ], uvdist, :res)
259- axisfields(fig[1 , 2 ], rd[2 ], uvdist, :res)
255+ fig, ax = plotfields(rd[1 ], uvdist, :res, axis_kwargs = (; ylabel = " Norm. Res. LCA" ))
256+ plotfields!(fig[2 , 1 ], rd[2 ], uvdist, :res, axis_kwargs = (; ylabel = " Norm. Res. CP" ))
260257DisplayAs. Text(DisplayAs. PNG(fig))
0 commit comments