Comments (7)
from fastplotlib.
install fastplotlib directly from main solves the above problem. But I got an error here:
iw.plot.canvas.close()
AttributeError Traceback (most recent call last)
Cell In[9], line 1
----> 1 iw.plot.canvas.close()
AttributeError: 'ImageWidget' object has no attribute 'plot'
When I tested the fastplotlib example, this error came up:
create a Plot
instance
plot = Plot()
get a grayscale image
data = iio.imread("imageio:camera.png")
plot the image data
image_graphic = plot.add_image(data=data, name="sample-image")
show the plot
plot.show(sidecar=True)
ZeroDivisionError Traceback (most recent call last)
Cell In[6], line 2
1 # create a Plot
instance
----> 2 plot = Plot()
4 # get a grayscale image
5 data = iio.imread("imageio:camera.png")
File H:\fastplotlib\fastplotlib\layouts_plot.py:48, in Plot.init(self, canvas, renderer, camera, controller, size, **kwargs)
12 def init(
13 self,
14 canvas: Union[str, WgpuCanvasBase] = None,
(...)
19 **kwargs,
20 ):
21 """
22 Simple Plot object.
23
(...)
46
47 """
---> 48 super().init(
49 parent=None,
50 position=(0, 0),
51 parent_dims=(1, 1),
52 canvas=canvas,
53 renderer=renderer,
54 camera=camera,
55 controller=controller,
56 **kwargs,
57 )
58 RecordMixin.init(self)
59 Frame.init(self)
File H:\fastplotlib\fastplotlib\layouts_subplot.py:73, in Subplot.init(self, parent, position, parent_dims, camera, controller, canvas, renderer, name)
31 """
32 General plot object that composes a Gridplot
. Each Gridplot
instance will have [n rows, n columns]
33 of subplots.
(...)
68
69 """
71 super(GraphicMethodsMixin, self).init()
---> 73 canvas, renderer = make_canvas_and_renderer(canvas, renderer)
75 if position is None:
76 position = (0, 0)
File H:\fastplotlib\fastplotlib\layouts_utils.py:30, in make_canvas_and_renderer(canvas, renderer)
24 raise TypeError(
25 f"canvas option must either be a valid WgpuCanvas implementation, a pygfx Texture"
26 f" or a str with the wgpu gui backend name."
27 )
29 if renderer is None:
---> 30 renderer = WgpuRenderer(canvas)
31 elif not isinstance(renderer, Renderer):
32 raise TypeError(
33 f"renderer option must be a pygfx.Renderer instance such as pygfx.WgpuRenderer"
34 )
File C:\ProgramData\anaconda3\envs\mescore\lib\site-packages\pygfx\renderers\wgpu_renderer.py:136, in WgpuRenderer.init(self, target, pixel_ratio, pixel_filter, show_fps, blend_mode, sort_objects, enable_events, gamma_correction, *args, **kwargs)
132 raise TypeError(
133 f"Render target must be a Canvas or Texture, not a {target.class.name}"
134 )
135 self._target = target
--> 136 self.pixel_ratio = pixel_ratio
137 self.pixel_filter = pixel_filter
139 # Make sure we have a shared object (the first renderer creates the instance)
File C:\ProgramData\anaconda3\envs\mescore\lib\site-packages\pygfx\renderers\wgpu_renderer.py:234, in WgpuRenderer.pixel_ratio(self, value)
232 target_lsize = self.logical_size
233 # Determine target ratio
--> 234 target_ratio = target_psize[0] / target_lsize[0]
235 # Use 2 on non-hidpi displays. On hidpi displays follow target.
236 self._pixel_ratio = float(target_ratio) if target_ratio > 1 else 2.0
ZeroDivisionError: division by zero
from fastplotlib.
I have fastplotlib 0.1.0a16, pygfx 0.1.18, and wgpu 0.15.1 installed.
from fastplotlib.
from fastplotlib.
It came with mesmerize-core pachage here: https://github.com/nel-lab/mesmerize-core
from fastplotlib.
from fastplotlib.
also see nel-lab/mesmerize-core#295 (comment)
from fastplotlib.
Related Issues (20)
- Know when a jupyter cell output has been "overwritten" HOT 2
- Color arrays HOT 1
- use of weakref.proxy HOT 1
- move nb testing module to withins source tree HOT 1
- error while trying simple.ipynb HOT 3
- last release for mesviz HOT 1
- docs on what fastplotlib is HOT 1
- pygfx optional picking
- explore, document, and type annotate supported array-like objects HOT 5
- Examples, tutorials, galleries in docs HOT 1
- 2D polygon graphics HOT 1
- ImageWidget should take `bool` rgb kwarg
- Scope of graphic features HOT 1
- sphinx breaking HOT 3
- Tutorial simple videoloop capture HOT 6
- Qt UI small toolbar buttons on Mac HOT 1
- Add arrow line graphic HOT 1
- Animations can be difficult to debug HOT 2
- rename `position_x`, `position_y`, `position_z` to offsets HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fastplotlib.