-
Notifications
You must be signed in to change notification settings - Fork 23
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
Misfit lune plot in matplotlib backed for deviatoric solutions #273
Comments
Hi @SeismoFelix , Sorry for the late reply: I got a solution for this -- you have to use the plot_misfit_lune(event_id+'DEV_misfit_lune.png', results, plot_type='colormesh')
plot_misfit_lune(event_id+'DEV_misfit_lune_tradeoffs.png', results, plot_type='colormesh', show_tradeoffs=True) should both be working and plot a result similar to what we had with GMT. The fix for this issue is going to be a small check in the code, to try to use the contour plot and fall back to the |
…sue #273 Added a conditional statement for the 'contour' plot mode. If the contour plot fails, it now produces an equivalent 'colormesh' plot.
Update misfit lune plot to account for deviatoric grids. Addresses issue #273
Solved with #288 |
Hi!
I am having issues with plotting the lune plot in the new matplotlib visualization backend. The problem seems to arise when a deviatoric grid-search (DC + CLVD). Although in this case, we are only using the lune longitude, this feature used to be functional in the previous backend with deviatoric solutions (see attached figures).
Here is the error I am getting:
Traceback (most recent call last): File "/home/scoped/inversiones/FK_GridSearch.DEV+Magnitude+Depth_Iceland.py", line 270, in <module> plot_misfit_lune(event_id+'DEV+Z_misfit.png', results) File "/home/scoped/mtuq/mtuq/graphics/uq/lune.py", line 63, in plot_misfit_lune _plot_lune(filename, misfit, **kwargs) File "/home/scoped/mtuq/mtuq/graphics/uq/lune.py", line 261, in _plot_lune backend(filename, File "/home/scoped/mtuq/mtuq/graphics/uq/_matplotlib.py", line 85, in _plot_lune_matplotlib im = ax.contourf(x, y, values, cmap=colormap, levels=levels, zorder=10) File "/opt/conda/lib/python3.10/site-packages/matplotlib/__init__.py", line 1465, in inner return func(ax, *map(sanitize_sequence, args), **kwargs) File "/opt/conda/lib/python3.10/site-packages/matplotlib/axes/_axes.py", line 6536, in contourf contours = mcontour.QuadContourSet(self, *args, **kwargs) File "/opt/conda/lib/python3.10/site-packages/matplotlib/contour.py", line 858, in __init__ kwargs = self._process_args(*args, **kwargs) File "/opt/conda/lib/python3.10/site-packages/matplotlib/contour.py", line 1523, in _process_args x, y, z = self._contour_args(args, kwargs) File "/opt/conda/lib/python3.10/site-packages/matplotlib/contour.py", line 1563, in _contour_args x, y, z = self._check_xyz(x, y, z_orig, kwargs) File "/opt/conda/lib/python3.10/site-packages/matplotlib/contour.py", line 1591, in _check_xyz raise TypeError(f"Input z must be at least a (2, 2) shaped array, " TypeError: Input z must be at least a (2, 2) shaped array, but has shape (1, 30)
It looks like the contour function in matplotlib expects a symmetric array and a deviatoric grid search has no points in the lune latitude.
Thanks for your help,
Felix
The text was updated successfully, but these errors were encountered: