Skip to content

Add option to transpose plot #1072

Open
@tylerflex

Description

@tylerflex

by default, plotting on a plane puts the lowest transverse dimension (in 'xyz') on the x axis and the highest on the y axis.

It would be useful to be able to switch this convention with an extra kwarg transpose: bool = False passed to Simulation.plot(), which would flip this convention.

Sim.plot(x=0) # yz plot
Sim.plot(x=0, transpose=False) # also yz plot
Sim.plot(x=0, transpose=True)  # zy plot
image

Notes:

  • should also be applied to Simulation.plot_eps()
  • This notebook can be useful for additional testing.
  • Be careful to ensure that the hlim and vlim arguments are applied to the transposed dimensions.

Deliverables:

  • PR into develop including
    • the front end code changes
    • a test that adds a transpose=True in a simulation plotting, eg in tests/test_components/test_simulation.py
    • a line in the changelog under "added" explaining what is done.

Notes:

  • We use git rebase to ensure that there's a linear history, so the feature branch ideally should be rebased against develop and squashed into a single commit.
  • For testing and formatting

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions