-
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
[WIP] Smart color scale: add percentile limits for smart color scale. #1259
[WIP] Smart color scale: add percentile limits for smart color scale. #1259
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1259 +/- ##
==========================================
+ Coverage 70.92% 72.45% +1.52%
==========================================
Files 74 74
Lines 8352 8415 +63
==========================================
+ Hits 5924 6097 +173
+ Misses 2428 2318 -110 |
…lorscale_limit_to_percentile
…inik-Vogel/Qcodes into smart_colorscale_limit_to_percentile
It would be super cool if we marked the clipped areas. The following prototype does that import matplotlib.pyplot as plt
import numpy as np
cmap = plt.cm.get_cmap("viridis")
cmap.set_over('magenta')
cmap.set_under('cyan')
fig, ax = plt.subplots(1,1)
pc = ax.pcolormesh(np.random.rand(100,100), cmap=cmap)
cb =fig.colorbar(pc, extend='both')
pc.set_clim(0.1, 0.9) |
That is great! Thank you for the code, I initially also tried that but couldn't get it to work. I'll include this feature. |
qcodes/dataset/plotting.py
Outdated
@@ -177,7 +184,8 @@ def plot_by_id(run_id: int, | |||
if rescale_axes: | |||
_rescale_ticks_and_units(ax, data, colorbar) | |||
if smart_colorscale: |
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.
could we add a info log message here with the limits used and how much is clipped
I just remembered the problem: It is all fine to set up the extend as you said, but I need to set it up after the colorbar has been created, and this does not seem to work well.... |
Ok finally found it @jenshnielsen . It seems to be an inconsistency in matplotlib. I will also need to redefine the slice that defines the points inside the colorbar:
Maybe we can make a PR for matplotlib next week... |
…lorscale_limit_to_percentile
…lorscale_limit_to_percentile
…inik-Vogel/Qcodes into smart_colorscale_limit_to_percentile
docs/Makefile
Outdated
jupyter-nbconvert --to rst 'examples/driver_examples/*.ipynb' --output-dir='_notebooks/driver_examples' | ||
jupyter-nbconvert --to rst 'examples/benchmarking/*.ipynb' --output-dir='_notebooks/benchmarking' | ||
jupyter-nbconvert --to rst "examples\plotting\*.ipynb" --ExecutePreprocessor.timeout=600 --ExecutePreprocessor.kernel_name=python3 --output-dir="_notebooks\plotting" | ||
cp -R "examples/files" "_notebooks/files" |
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.
is indentation ok? (it probably does not matter though... i forgot)
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.
yeah, that is apparently two spaces vs one tab...
…lorscale_limit_to_percentile
…inik-Vogel/Qcodes into smart_colorscale_limit_to_percentile
This is marked as WIP as it will need to be merged together with the corresponding qdev wrappers pr.
Enable to limit the maximum percentage of datapoints that may be clipped by the smart color scale on either side of the distribution.
This method has the advantage not enable to control how much to discard of a signal on a noisy background as an outlier. The simulated data tries to resemble a relevant measurement situation.
Side effects:
plot_by_id
not using the color map as defined inqcodesrc.json
no smart color scale:
no limiting of percentiles:
with limiting percentiles = 0.5