Python Forum
Plotting level curves (isocurves) with pyqtgraph
Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Plotting level curves (isocurves) with pyqtgraph
#1
Hi everyone,

I am trying to plot a red loop (isocurve) that correspond to the level z=2 of a given surface. Maybe I am able to create the isocurve, but I cannot overlap it to the grayscale image. (Output image)
I have been trying for days, but wasn't able to find any working example on the internet (isocurve.py included).
Can anybody provide me a working piece of code?

Thank you very much.

Here's the code.

from pyqtgraph.Qt import QtGui,QtCore
import numpy as np
import pyqtgraph as pg
import sys

app=QtGui.QApplication([])
x=np.linspace(0,6.28,30)
y=x[:]
xx,yy=np.meshgrid(x,y)
z=np.sin(xx)+np.cos(yy)

window=pg.GraphicsWindow()
window.setWindowTitle('isocurve example')
vb=window.addViewBox()
img=pg.ImageItem(z)
vb.addItem(img)
vb.setAspectLocked()

c=pg.IsocurveItem(level=2,pen='b')
c.setParentItem(img)
c.setZValue(0.5)
vb.addItem©


window.show()
sys.exit(app.exec_())


I forgot to say that I am forced to use the library pyqtgraph.
matplotlib solutions are not allowed.
Reply
#2
Since this is relatively specialized, you might want to try a more specialized community. If you do find the answer though, we'd definitely be curious about the solution!
Reply
#3
[SOLVED] here: http://stackoverflow.com/questions/39792...h-isocurve
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Plot multiple 2D Curves in 3D stc 5 894 Jun-11-2023, 05:48 PM
Last Post: snippsat
  Plot a pandas data fram via pyqtgraph with an modul import and qt designer widget Nietzsche 0 802 May-29-2023, 02:42 PM
Last Post: Nietzsche
  Query regrading plotting 95 % significance level PreetiRajpoot 0 1,526 Mar-09-2021, 04:00 PM
Last Post: PreetiRajpoot
  Level curves don't match after rotation schniefen 1 1,503 Dec-14-2020, 09:56 PM
Last Post: schniefen
  how to show the distance between two curves in a graph termo 6 6,923 Oct-21-2019, 09:08 AM
Last Post: DeaD_EyE
  Finding the intersection of interpolated curves Tina 1 4,122 Mar-23-2017, 05:33 PM
Last Post: zivoni

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020