-
Notifications
You must be signed in to change notification settings - Fork 301
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
plot_by_id: pass kwargs to subplots and plot function #1258
plot_by_id: pass kwargs to subplots and plot function #1258
Conversation
qcodes/dataset/plotting.py
Outdated
axes.append(ax) | ||
else: | ||
if len(subplots_kwargs) == 0: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this not be !=
@jenshnielsen do you approve with the fixed comparison? |
Codecov Report
@@ Coverage Diff @@
## master #1258 +/- ##
==========================================
+ Coverage 70.66% 70.67% +<.01%
==========================================
Files 74 74
Lines 8165 8174 +9
==========================================
+ Hits 5770 5777 +7
- Misses 2395 2397 +2 |
qcodes/dataset/plotting.py
Outdated
FIGURE_KWARGS.remove('kwargs') | ||
SUBPLOTS_KWARGS = set(inspect.signature(plt.subplots).parameters.keys()) | ||
SUBPLOTS_KWARGS.remove('fig_kw') | ||
SUBPLOTS_KWARGS = FIGURE_KWARGS.union(SUBPLOTS_KWARGS) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For readability i would prefer if the union was called something else that the individual set
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Does it make sense to add a test for this?
I decided against a test because there are not any tests for the plotting yet (except for the labels) and it is not highest prio.... |
This pr enables the use of kwargs in
plot_by_id
. The kwargs applicable toplt.subplots
are passed upon axis creation. The kwargs that remain are passed to the consequently called plotting function likeplot
,scatter
orpcolormesh
.