implement fill for connect="finite"#3071
Merged
j9ac9k merged 2 commits intopyqtgraph:masterfrom Jun 29, 2024
Merged
Conversation
Contributor
|
I have no further comments. :) |
Contributor
Author
|
this PR seems to fix #2312 |
j9ac9k
reviewed
Jun 25, 2024
| baseline=None | ||
| ) | ||
|
|
||
| if not self.opts['skipFiniteCheck']: |
Member
There was a problem hiding this comment.
I love that this check on skipFiniteCheck is going away!
Contributor
Author
|
An animation to demonstrate this PR as well as #3068 import random
import numpy as np
import pyqtgraph as pg
from pyqtgraph.Qt import QtCore
# pg.setConfigOptions(useOpenGL=True, enableExperimental=True)
pg.mkQApp()
plt = pg.PlotWidget()
plt.show()
data = np.zeros(1000)
data[:-1] = np.nan
curve = pg.PlotCurveItem(data, connect="finite", fillLevel=0.0, brush=(50, 50, 200, 100))
plt.addItem(curve)
def update():
val = random.gauss(0, 1)
data[:-1] = data[1:]
data[-1] = data[-2] + val
# inject a nan every now and then
if random.randrange(500) == 0:
data[-2] = np.nan
level = np.nanmean(data)
curve.setData(data, fillLevel=level)
timer = QtCore.QTimer()
timer.timeout.connect(update)
timer.start(0)
pg.exec() |
Member
|
Love the diff @pijyoi thanks for simplifying one of our most used GraphicsItems. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Implement the fill behavior for
connect="finite"as defined in #3068