8000 Add support for Matplotlib 2.2 by jenshnielsen · Pull Request #1119 · microsoft/Qcodes · GitHub
[go: up one dir, main page]

Skip to content

Add support for Matplotlib 2.2 #1119

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

Merged
merged 11 commits into from
Jun 6, 2018

Conversation

jenshnielsen
Copy link
Collaborator

Matplotlib no longer works with nans in the x and y coordinates for pcolormesh. This fills out any missing values by extrapolating based on the step size or the existing data, falling back to a default stepsize if there is only one line. IMHO this also makes the code for shifting coordinates from bin centers to edges slightly simpler.

@ThorvaldLarsen I think you saw this issue somewhere in the qdev wrappers.

@QCoDeS/core

@ThorvaldLarsen
Copy link
Contributor

I tried running with matplotlib 2.2 in connection with qdev-dk/qdev-wrappers#88 and ran into errors with plotting. However, turned out the problem we were trying to solve was unrelated to matplotlib version.

@jenshnielsen
Copy link
Collaborator Author

@ThorvaldLarsen I was referring to this one which I think depend on matplotlib version and which this fixes

@Dominik-Vogel @jenshnielsen just FYI: qcodes MatPlot fails for interrupted scans with matplotlib version 2.2.2 due to a change in handling of MaskedArrays matplotlib/matplotlib#9723. pcolormesh throws this error: ValueError: x and y arguments to pcolormesh cannot have non-finite values or be of type numpy.ma.core.MaskedArray with masked values when trying to plot the data.

@codecov
Copy link
codecov bot commented Jun 4, 2018

Codecov Report

Merging #1119 into master will increase coverage by 0.21%.
The diff coverage is 75%.

@@            Coverage Diff            @@
##           master   #1119      +/-   ##
=========================================
+ Coverage   78.79%     79%   +0.21%     
=========================================
  Files          46      46              
  Lines        6564    6573       +9     
=========================================
+ Hits         5172    5193      +21     
+ Misses       1392    1380      -12

@jenshnielsen jenshnielsen reopened this Jun 4, 2018
# numpy (1.14) has a deprecation warning related to shared
# masks
# lets silence this by making sure that this is not shared
# before
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PEP8 is nice and all but IMHO this indentation is worse than too long lines 😛

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I'm still getting used to VSCode. That would just have been meta+q in Emacs... sigh...

8000

# now shift to get edges coordinates rather than center
# coordinates
# first Add padding on both sides equal to endpoints
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment is now wrong. Perhaps we should just use insert, That seems simpler than pad for this

Copy link
Contributor
@WilliamHPNielsen WilliamHPNielsen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got mixed up a bit between reviewer and author, but I approve.

8000

assert len(args[0]) == M + 1
assert len(args[1]) == N + 1

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we not test that the content of x and y is as expected too?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes... the test can/should be extended a lot. I just got very lazy.

@jenshnielsen jenshnielsen merged commit 5258016 into microsoft:master Jun 6, 2018
@jenshnielsen jenshnielsen deleted the matplotlib22 branch November 6, 2018 09:06
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.

3 participants
0