Skip to content

fix: Fixed to add_to_canvas() returns ax instead of plots#989

Open
i-aki-y wants to merge 2 commits intoSheffieldML:develfrom
i-aki-y:fix-plot
Open

fix: Fixed to add_to_canvas() returns ax instead of plots#989
i-aki-y wants to merge 2 commits intoSheffieldML:develfrom
i-aki-y:fix-plot

Conversation

@i-aki-y
Copy link
Copy Markdown

@i-aki-y i-aki-y commented Aug 1, 2022

I want to fix the error which is discussed in #920.

The plotting.show() function is a alias of the show_canvas() method and it expect for an ax object in matplotlib, while the GP.plot()(==add_to_canvas()) function returns plots dict.

See also:

def show_canvas(self, ax, **kwargs):
ax.figure.canvas.draw()
return ax.figure

To fix this, I just replace the return value of add_to_canvas() from plots to ax.

Note:
The return value of the add_to_canvas() function was changed at the commit 4f3047e from ax to plots.
Unfortunately, I could not find the reason why this fix was needed.

I would appreciate it if you reviewed this.

@codecov
Copy link
Copy Markdown

codecov Bot commented Aug 1, 2022

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 54.51%. Comparing base (f63ed48) to head (2b3e705).
⚠️ Report is 306 commits behind head on devel.

Additional details and impacted files
@@            Coverage Diff             @@
##            devel     #989      +/-   ##
==========================================
+ Coverage   54.49%   54.51%   +0.01%     
==========================================
  Files         210      210              
  Lines       21560    21560              
  Branches     3169     3169              
==========================================
+ Hits        11750    11753       +3     
+ Misses       9255     9252       -3     
  Partials      555      555              
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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 this pull request may close these issues.

1 participant