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

plot2d can't set a specified cmap #179

Open
bzdzdxb opened this issue Oct 23, 2023 · 1 comment
Open

plot2d can't set a specified cmap #179

bzdzdxb opened this issue Oct 23, 2023 · 1 comment
Labels

Comments

@bzdzdxb
Copy link

bzdzdxb commented Oct 23, 2023

when I finish a workflow and I want to plot my GRADIENT_01 with a specified cmap, I use the following command:

$ seisflows plot2d GRADIENT_01 vp_kernel -c seismic

I get the error message:

Traceback (most recent call last):
File "/home/zhaox/anaconda3/envs/py311/bin/seisflows", line 8, in <module>
sys.exit(main())
^^^^^^
File "/home/zhaox/seisflows-master/seisflows/seisflows.py", line 1396, in main
sf()
File "/home/zhaox/seisflows-master/seisflows/seisflows.py", line 447, in call
getattr(self, self._args.command)(**vars(self._args))
File "/home/zhaox/seisflows-master/seisflows/seisflows.py", line 1118, in plot2d
plot_model.plot2d(parameter=parameter, cmap=cmap, show=True,
File "/home/zhaox/seisflows-master/seisflows/tools/model.py", line 585, in plot2d
zero_midpoint=zero_midpoint)
^^^^^^^^^^^^^
UnboundLocalError: cannot access local variable 'zero_midpoint' where it is not associated with a value

It is because if I set the value of cmap, then the zero_midpoint will not be assigned a value.

I think it is easy to fix. Thx.

@bch0w
Copy link
Member

bch0w commented Oct 24, 2023

Hi @bzdzdxb, thanks for raising this issue, glad to see the plotter is being used! I will give this a look this week and get back to you!

@bch0w bch0w added the bug label Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants