fix: Fixed to add_to_canvas() returns ax instead of plots #989
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.
I want to fix the error which is discussed in #920.
The
plotting.show()
function is a alias of theshow_canvas()
method and it expect for anax
object in matplotlib, while theGP.plot()
(==add_to_canvas()
) function returnsplots
dict.See also:
GPy/GPy/plotting/matplot_dep/plot_definitions.py
Lines 95 to 97 in f63ed48
To fix this, I just replace the return value of
add_to_canvas()
fromplots
toax
.Note:
The return value of the
add_to_canvas()
function was changed at the commit 4f3047e fromax
toplots
.Unfortunately, I could not find the reason why this fix was needed.
I would appreciate it if you reviewed this.