|
23 | 23 | sitecolormap = :Spectral_9, |
24 | 24 | hopcolor = missing, # accepts ((i,j), (r,dr)) -> float, IndexableObservable |
25 | 25 | hopopacity = missing, # accepts ((i,j), (r,dr)) -> float, IndexableObservable |
26 | | - minmaxhopradius = (0.0, 0.2),# when hopradius is a function, range of values to scale to |
27 | | - hopradius = 0.1, # accepts ((i,j), (r,dr)) -> float, IndexableObservable |
| 26 | + minmaxhopradius = (0.0, 0.1),# when hopradius is a function, range of values to scale to |
| 27 | + hopradius = 0.03, # accepts ((i,j), (r,dr)) -> float, IndexableObservable |
28 | 28 | hopdarken = 0.85, |
29 | 29 | hopcolormap = :Spectral_9, |
30 | 30 | hoppixels = 2, |
@@ -334,11 +334,12 @@ primitive_radius(normr, radius, (minr, maxr)) = minr + (maxr - minr) * normr |
334 | 334 |
|
335 | 335 | ## retract_hops! ## |
336 | 336 |
|
337 | | -function retract_hops!(hp::HoppingPrimitives, sp::SitePrimitives) |
| 337 | +function retract_hops!(hp::HoppingPrimitives, sp::SitePrimitives, plot) |
338 | 338 | for n in eachindex(hp.vectors) |
339 | 339 | r, dr = hp.centers[n], hp.vectors[n] |
340 | 340 | _, j = hp.indices[n] |
341 | 341 | R, Rj = hp.radii.data[n], sp.radii.data[j] |
| 342 | + plot[:flat][] && (R = zero(R)) |
342 | 343 | dl = (Rj>R ? sqrt(Rj^2-R^2) : 0.0) * dr/norm(dr) |
343 | 344 | dr´ = dr - dl |
344 | 345 | r´ = r + 0.5 * dl |
@@ -490,10 +491,8 @@ function Makie.plot!(plot::PlotLattice{Tuple{H,S,S´}}) where {H<:Hamiltonian,S< |
490 | 491 | else |
491 | 492 | joint_colors_radii_update!(hp, hp´, plot) |
492 | 493 | end |
493 | | - if !plot[:flat][] |
494 | | - retract_hops!(hp, sp) |
495 | | - retract_hops!(hp´, sp) |
496 | | - end |
| 494 | + retract_hops!(hp, sp, plot) |
| 495 | + retract_hops!(hp´, sp, plot) |
497 | 496 | end |
498 | 497 |
|
499 | 498 | # plot hops |
@@ -714,8 +713,9 @@ function plotbravais!(plot::PlotLattice, lat::Lattice{<:Any,E,L}, latslice) wher |
714 | 713 | vtot = sum(vs) |
715 | 714 | r0 = Point{E,Float32}(Quantica.mean(Quantica.sites(lat))) - 0.5 * vtot |
716 | 715 | if !ishidden(:axes, plot) |
| 716 | + markerscale = maximum(norm, vs) * 0.2 |
717 | 717 | for (v, color) in zip(vs, (:red, :green, :blue)) |
718 | | - arrows3d!(plot, [r0], [v]; color, inspectable = false, markerscale = 1) |
| 718 | + arrows3d!(plot, [r0], [v]; color, inspectable = false, markerscale) |
719 | 719 | end |
720 | 720 | end |
721 | 721 | if !ishidden((:cell, :cells), plot) && L > 1 |
|
0 commit comments