Skip to content
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

Center the colormap produced by partial_deriv_plot around 0 #3174

Closed
cfe316 opened this issue Apr 2, 2024 · 0 comments · Fixed by #3175
Closed

Center the colormap produced by partial_deriv_plot around 0 #3174

cfe316 opened this issue Apr 2, 2024 · 0 comments · Fixed by #3175
Assignees

Comments

@cfe316
Copy link
Contributor

cfe316 commented Apr 2, 2024

Desired capability or behavior.

The check_partials tool coupled with partial_deriv_plot has been really useful in debugging some components and learning how to set up sparse partials.

One of the plots it produces is a map of the difference between J_fd and J_fwd. Right now it uses a diverging colormap, but it's not used quite properly. This sort of diverging colormap is designed for data centered around zero, where values of zero (meaning success in this application!) are gray, low values are blue, and high values are red.

Right now, the colormap has limits (probably set with a vmin and vmax) which are something like vmin=min(data), vmax=max(data). But, if positive errors are larger than negative errors, for example, then zero values are not gray, and the whole plot is tinted one way or the other.

One solution would be to precompute z = max(abs(min(data)), abs(max(data))) and set vmin=-z, vmax=z to force a centered color bar.

Associated POEM

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants