-
Notifications
You must be signed in to change notification settings - Fork 66
feat(FXC-3536): add log and symlog plot scale #2864
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
momchil-flex
reviewed
Oct 3, 2025
yaugenst-flex
requested changes
Oct 7, 2025
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
marc-flex
approved these changes
Oct 8, 2025
d45f4ee
to
a8b50fc
Compare
5114878
to
5f98371
Compare
5f98371
to
a7a8cad
Compare
Jira: FXC-3536
a7a8cad
to
acd5523
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Greptile Overview
Updated On: 2025-10-03 10:54:12 UTC
Summary
This PR adds logarithmic and symmetric logarithmic scaling support to Tidy3D's plotting functionality. The changes enhance the visualization capabilities by expanding the available scale options from just linear ('lin') and decibel ('dB') to include logarithmic ('log') and symmetric logarithmic ('symlog') scales.The implementation involves two main components: First, the
PlotScale
type definition intidy3d/components/types/base.py
is updated to include the new scale options. Second, the plotting infrastructure intidy3d/components/scene.py
is modified to handle these new scales using matplotlib's normalization objects (LogNorm
andSymLogNorm
).The core plotting methods like
plot_structures_eps
andplot_structures_property
now accept ascale
parameter and use appropriate matplotlib normalizations instead of simplevmin
/vmax
parameters. For symmetric logarithmic scaling, the implementation includes sophisticated logic to calculate appropriate linear threshold (linthresh
) values, particularly for doping concentration data where values can span many orders of magnitude and include both positive and negative values.This enhancement integrates seamlessly with Tidy3D's existing plotting architecture and follows matplotlib's standard conventions. The change is particularly valuable for electromagnetic simulations where field data, power quantities, and material properties often span wide dynamic ranges that benefit from logarithmic visualization.
Important Files Changed
Changed Files
Confidence score: 4/5