|
This looks like a great start! Do you want to implement more of what's in #403 or we'll just use this for now and implement the rest when we can. I have a bunch of changes to make but I think it's easier if I edit your branch directly if you don't mind. |
Sorry, something went wrong.
| def update_using_camera(self): | ||
| """ | ||
| Update the legend position and scale using the camera. | ||
| This only works if legend is in a Dock, not a Plot or Subplot. | ||
| """ |
There was a problem hiding this comment.
This will be much easier after #830 is merged (by tomorrow) since it adds an overlay render pass.
Sorry, something went wrong.
| ) | ||
|
|
||
| # Subplot | ||
| self.ax = self.fig[0, 0] |
There was a problem hiding this comment.
let's just call these subplot instead of ax to conform with the rest of the examples, I can make these changes if you want
Sorry, something went wrong.
| def rotate(angle, axis_x, axis_y, axis_z): | ||
| """ | ||
| Quaternion representing rotation around the given axis by the given angle. | ||
| """ | ||
| a2 = angle/2.0 | ||
| c = cos(a2) | ||
| s = sin(a2) | ||
| return (axis_x * s, axis_y * s, axis_z * s, c) |
There was a problem hiding this comment.
nice, would be useful to have this in the addition to the existing Graphic.rotate
Sorry, something went wrong.
| # X label | ||
| self.ax.docks["bottom"].size = 30 | ||
| self.ax.docks["bottom"].add_text( | ||
| "X", | ||
| font_size=16, | ||
| face_color=(0, 0, 0, 1), | ||
| anchor="middle-center", | ||
| offset=(0, 0, 0), | ||
| ) | ||
| self.ax.docks["bottom"].background_color = self.WHITE | ||
|
|
||
| # Y label | ||
| q = rotate(pi/2.0, 0., 0., 1.) # rotate 90 deg around z-axis | ||
| self.ax.docks["left"].size = 30 | ||
| self.ax.docks["left"].add_text( | ||
| "Y", | ||
| font_size=16, | ||
| face_color=(0, 0, 0, 1), | ||
| anchor="middle-center", | ||
| offset=(0, 0, 0), | ||
| rotation=q, | ||
| ) |
There was a problem hiding this comment.
pygfx will have seen soon, let's wait until we have the proper implementation pygfx/pygfx#739
Sorry, something went wrong.
| self.ax.docks["top"].size = 30 | ||
| self.ax.docks["top"].add_text( | ||
| "Line Plots", | ||
| font_size=16, | ||
| face_color=(0, 0, 0, 1), | ||
| anchor="middle-center", | ||
| offset=(0, 0, 0), | ||
| ) | ||
| self.ax.docks["top"].background_color = self.WHITE |
There was a problem hiding this comment.
why not subplot.title = "title"?
Sorry, something went wrong.
|
Nice work! I was taking a look at your repos, are you trying to create something like this https://github.com/uutzinger/SerialUI ? Curious to hear how fastplotlib has been working for your use case. |
Sorry, something went wrong.
|
Nice work! I was taking a look at your repos, are you trying to create something like this https://github.com/uutzinger/SerialUI ? Curious to hear how fastplotlib has been working for your use case. Yes that is why I am looking into fastplotlib. I hope to have some working prototype with fastplotlib shortly. I have been trying to figure out what the advantage of fastplotlib might be compared to pyqtgraph which is what I am currently using.
|
Sorry, something went wrong.
|
Nice work! I was taking a look at your repos, are you trying to create something like this https://github.com/uutzinger/SerialUI ? Curious to hear how fastplotlib has been working for your use case. Yes that is why I am looking into fastplotlib. I hope to have some working prototype with fastplotlib shortly. I have been trying to figure out what the advantage of fastplotlib might be compared to pyqtgraph which is what I am currently using.
We rely on the community for more detailed Qt examples, thanks for your contribution! We're not a Qt lib like pyqtgraph, wgpu can render to a anything that rendercanvas supports.
How many lines are your plotting and how many points per line? Is your 3060 selected or integrated graphics?
I'm hoping to make a benchmark for fastplotlib soon, you can take a look at the pygfx benchmarks for now: https://github.com/pygfx/pygfx-benchmarks
I think the rendering is intentionally paused when the canvas is being resized. |
Sorry, something went wrong.
|
Nice work! I was taking a look at your repos, are you trying to create something like this https://github.com/uutzinger/SerialUI ? Curious to hear how fastplotlib has been working for your use case. Yes that is why I am looking into fastplotlib. I hope to have some working prototype with fastplotlib shortly.
We rely on the community for more detailed Qt examples, thanks for your contribution! We're not a Qt lib like pyqtgraph, wgpu can render to a anything that rendercanvas supports.
How many lines are your plotting and how many points per line? Is your 3060 selected or integrated graphics?
I'm hoping to make a benchmark for fastplotlib soon, you can take a look at the pygfx benchmarks for now: https://github.com/pygfx/pygfx-benchmarks
I think the rendering is intentionally paused when the canvas is being resized. Test Programs3 x 50_000 line segments per frame Hardware Options
Running on Ubuntu FASTPLOTLIB PerformanceNividia 3060 VulkanLines/s: 10,215,192, Interval: 1.011 Generating: 4.1% FPS: 63.40 Python Main Thread usage: 60.3% fullscreenLines/s: 5,058,138, Interval: 1.048 Generating: 3.8% FPS: 31.27 Python Main Thread usage: 48.7% Radeon VulkanLines/s: 11,278,138, Interval: 1.007 Generating: 4.9% FPS: 75.57 Python Main Thread usage: 75.6% fullscreenLines/s: 5,571,927, Interval: 1.055 Generating: 3.0% FPS: 34.26 Python Main Thread usage: 49.8% CPU/LLVM VulkanLines/s: 350,917, Interval: 1.715 Generating: 0.3% FPS: 2.33 Python Main Thread usage: 4.1% fullscreenLines/s: 540,940, Interval: 1.112 Generating: 0.3% FPS: 3.39 Python Main Thread usage: 6.4% Radeon OpenGLLines/s: 14,919,069, Interval: 1.010 Generating: 6.4% FPS: 88.10 Python Main Thread usage: 86.6% fullscreenLines/s: 5,379,418, Interval: 1.041 Generating: 3.5% FPS: 32.88 Python Main Thread usage: 49.2% PYQTGRAPH Performanceregular windowLines/s: 6,333,290, Interval: 1.018 Generating: 2.3% FPS: 41.75 Python Main Thread usage: 82.8% full screenLines/s: 2,195,240, Interval: 1.033 Generating: 0.8% FPS: 14.54 Python Main Thread usage: 72.9% |
Sorry, something went wrong.
|
Thanks for the example, we're a bit busy with other projects at the moment so I'll incorporate your changes next month. |
Sorry, something went wrong.
|
legend.py |
Sorry, something went wrong.
|
Hi sorry I haven't had time to follow up on this. We're pretty busy with other low level priorities at the moment. If you'd like to contribute to a fully-fledged legend we outlined our ideas here, some of the ideas do need to be updated w.r.t. recent improvement in pygfx & fpl: #403 Legends should go in the overlay render pass that was introduced in #830, so updating with camera changes won't be necessary. I'm not sure if we still want to do a separate colorbar when colormaps are used for lines, it may make sense to derive something from the existing HistogramLUTTool. |
Sorry, something went wrong.
|
This is as far as I got with fastplotlib in my charting app: Recording made for this response (on youtube) The legend placing could be improved but runs with latest fpl from github. The way it looks like with pyqtgraph can be seen in the app repo https://github.com/uutzinger/SerialUI. The updated legends.py I use is in https://github.com/uutzinger/SerialUI/tree/main/Python_libraries/fastplotlib/legends The charting in my application works similar to Electromagnetic Wave Animation in your Examples. |
Sorry, something went wrong.
Updated legend.py:
Example qt/lineplot.py
gitignore
testing