tidy3d icon indicating copy to clipboard operation
tidy3d copied to clipboard

Plot transposing for simulation plotting

Open m-bone opened this issue 1 year ago • 0 comments

Addressing #1072 need for transposing 2D plots produced from Simulations.

There is no simple matplotlib method for transposing Axes objects. It seems to have been overlooked as our use case of building axes by iteratively adding is rather uncommon. My current thinking leaves two options:

A. Manually perform a transposition on the finished axes object by rotating 90 degrees and mirroring the x axis. B. Transpose each individual component of the simulation.

B seems an obscene amount of effort and opens up all sorts of risks of modifying in-place and copying the simulation so that the original simulation is unchanged for downstream operations.

The mirroring in A is simple because the axes.invert_xaxis() method handles this. The rotation is proving more challenging because you have to use floating_axes from matplotlibs axisartist module. These either aren't playing nice with the existing design, or I've not implemented them correctly, because the best I can do is part of the target subplot embedded within a larger blank figure. Will continue to consider other options and try explore this further.

m-bone avatar Jul 09 '24 15:07 m-bone