You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi!
Are there any examples about the usage with glfw?
I'm trying to understand if I can use fastplotlib with https://github.com/pthom/imgui_bundle (that relies on glfw).
fromfastplotlibimportPlot, runimportimageio.v3asiio# force glfwplot=Plot(canvas="glfw")
data=iio.imread("imageio:camera.png")
# plot the image dataimage_graphic=plot.add_image(data=data, name="iio camera")
plot.show()
plot.canvas.set_logical_size(800, 800)
plot.auto_scale()
# show and runplot.show()
run()
You can also use the example notebooks and pass canvas="glfw" to Plot or GridPlot and it will use the glfw canvas without blocking notebook executation.
Hi @kushalkolar!
Thanks a lot for your answer!
Your example works fine!
I'll let you know if I manage to make it work with imgui-bundle, which is a batteries-included version of pyimgui.
Hey @kushalkolar,
I'm really sorry, but I stopped working on the imgui project a few weeks after I opened this issue and I totally forgot to reply here. My apologies!
Unfortunately I haven't had the chance to try it out. The original idea was trying to mimic what is being done in this fantastic series (at a much simpler level, of course), but with numpy, numba and imgui. Then I thought I could try use fastplotlib to display the image in real time.
Unfortunately, other priorities had arrived in the mean time, and I abandoned the project. Sorry again.
Thanks for the update! Creating viewports/subplots in a drag-drop-resize fashion would be really cool. I might just try and learn ImGUI soon and try to do it myself, but it has been years since I've touched C++ and my C++ abilities are very basic.
I don't think that using C++ is necessary here. The python bindings provide the same functionalities. However, I don't know if fastplotlib can be used to display an image inside an imgui window.
Activity
kushalkolar commentedon Jun 24, 2023
Hi! Thanks for your interest! I am also interested in integrating this with
imgui, see this recent dicussion: pyimgui/pyimgui#336I just pushed a new release which contains a small fix to make the minimal install work: https://github.com/kushalkolar/fastplotlib#minimal-use-with-your-own-qt-or-glfw-applications
You will need to
pip install glfwin addition to that.For examples using
glfw, use any of the desktop examples here:https://github.com/kushalkolar/fastplotlib/tree/master/examples/desktop
Give the kwarg
canvas="glfw"when constructing aPlotorGridPlotto forceglfw. Don't forget to callfpl.run()at the end.For example with
image_simple.py: https://github.com/kushalkolar/fastplotlib/blob/master/examples/desktop/image/image_simple.pyYou can also use the example notebooks and pass
canvas="glfw"toPlotorGridPlotand it will use the glfw canvas without blocking notebook executation.mbignotti commentedon Jun 26, 2023
Hi @kushalkolar!
Thanks a lot for your answer!
Your example works fine!
I'll let you know if I manage to make it work with
imgui-bundle, which is a batteries-included version ofpyimgui.Thank you!
kushalkolar commentedon Jun 26, 2023
My guess is that imgui integration would probably be done with
wgpu-pyandpygfx, sincefastplotlibis built on top ofpygfx.See related discussion: pyimgui/pyimgui#336
I don't have experience with imgui, very interested to see what you find out!
kushalkolar commentedon Oct 24, 2023
@mbignotti wondering if you were able to try this out?
mbignotti commentedon Oct 24, 2023
Hey @kushalkolar,
I'm really sorry, but I stopped working on the imgui project a few weeks after I opened this issue and I totally forgot to reply here. My apologies!
Unfortunately I haven't had the chance to try it out. The original idea was trying to mimic what is being done in this fantastic series (at a much simpler level, of course), but with numpy, numba and imgui. Then I thought I could try use fastplotlib to display the image in real time.
Unfortunately, other priorities had arrived in the mean time, and I abandoned the project. Sorry again.
kushalkolar commentedon Oct 24, 2023
Thanks for the update! Creating viewports/subplots in a drag-drop-resize fashion would be really cool. I might just try and learn ImGUI soon and try to do it myself, but it has been years since I've touched C++ and my C++ abilities are very basic.
mbignotti commentedon Oct 25, 2023
I don't think that using C++ is necessary here. The python bindings provide the same functionalities. However, I don't know if fastplotlib can be used to display an image inside an imgui window.
kushalkolar commentedon Jul 30, 2024
Hi, this is finally being worked on in #571