-
Notifications
You must be signed in to change notification settings - Fork 281
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
Update plot_modifications.py #5116
base: main
Are you sure you want to change the base?
Conversation
Hi! Welcome, and thanks for opening this pull request. We have some guidelines for new pull requests, and soon you'll hear back about the results of our tests and continuous integration checks. Thank you for your contribution! |
@tiapac did you mean to close this one? |
Yes, I modified through the online editor, so I was worried that the indentation was not correct. I also wanted to add a bit of context to the changes for future references. I tested it locally and it's ok, so I'll reopen it. |
pre-commit.ci autofix |
for more information, see https://pre-commit.ci
@tiapac I just triggered the pre-commit bot to fix the failing style check: locally you'll want to run |
The type check test gives an error here:
I think it is because if
|
yup! that should fix it. |
Changed ``plot_args`` to ``self.plot_args`` in the if/in check
I noticed that making a contour plot does not allow me to use the kwarg "cmap" in the 'plot_args' dictionary.
If I add the "cmap" key work to 'plot_args' as in
returns
The cause is that by default yt partially generate said dictionary ( in yt/visualization/plot_modifications.py, line 931 ) and then add the user supplied options:
This generate a conflict in matplotlib because when "colors" is supplied, "cmap" is not accepted.
A solution might be to only add the default values if they are not supplied by the user in
plot_args
, as also suggested by @chrishavlin .This is the content of the pull request.