Band in CairoMakie makes whole plot black

function plotSmallSlices(allDiffs::smallDict,key::String,bytes::Integer)
  # one round, as more would look like noise
  sl=Figure(size=(1189,841))
  slax=Axis3(sl[1,1],
	     title=(@sprintf "Wring differential cryptanalysis, %s, %d bytes" key bytes),
	     xlabel="Output bit",
	     ylabel="Input bit",
	     zlabel="Probability same")
  xs=0:bytes*8-1
  for inbit in 0:bytes*8-1
    zs=OffsetArrays.no_offset_view(allDiffs[key][bytes,1][:,inbit])
    #band!(slax,Point3d.(xs,inbit,0),Point3d.(xs,inbit,zs),transparency=true,alpha=0.2)
    lines!(slax,Point3d.(xs,inbit,zs))
  end
  filename=@sprintf "smallDiffs-%s-%d.svg" key bytes
  save(filename,sl)
end

function plotSmallDiffs()
  allDiffs=readAllSmallDiffs()
  plotSmallSlices(allDiffs,"96_0",3)
end

I run this and I get an SVG file which shows a 3D box in a not quite isometric view with lots of lines in it. The z-axis goes from 0.04 to around 0.135. I’d like to see for each line a card with the line at top, so I add the band! line, here commented out. It takes a lot longer to plot, and the entire plot is black. What happened? Does band! work only with GLMakie?

The code is at GitHub - phma/WringTwistreeCryptanalysis.jl: Cryptanalysis of the Wring cipher and Twistree hash function , but it takes 30 hours (on my laptop, which has 32 CPU threads) to generate all the data files.

CairoMakie doesn’t do well when drawing commands fall back to mesh drawing, Cairo has only a somewhat buggy command for this which messes up svgs. It kind of rasterizes everything in a half broken way.

I assume the band with 3D points causes this here as a 3D band cannot generally be drawn with a polygon, which is what a 2D band is drawn as in CairoMakie if possible. As your band lies in a certain plane, you could try the method with 2D data and transform = (:xy, 0) or so, maybe google around for some examples. This would shift the 2D band around in 3D space but CairoMakie could still use one of the polygon drawing overloads. Not guaranteed to look good though, if there’s actual overlaps of data in 3D as CairoMakie has no z buffer. GLMakie would be better in that case.