Skip to content

AttributeError: 'ImFontAtlas' object has no attribute 'get_tex_data_as_rgba32' when running minimal example #875

@SasiMitraB

Description

@SasiMitraB

I'm trying to run the minimal example from the docs, but it raises an AttributeError related to ImFontAtlas.

Code causing the error:

import fastplotlib as fpl
import imageio.v3 as iio

# create a `Figure`
fig = fpl.Figure()

# read data
data = iio.imread("imageio:astronaut.png")

# add image graphic
image_graphic = fig[0, 0].add_image(data=data)

# show the plot
fig.show()

if __name__ == "__main__":
    fpl.run()

Full output from script

No config found!
EGL says it can present to the window but not natively
Max vertex attribute stride unknown. Assuming it is 2048
Max vertex attribute stride unknown. Assuming it is 2048
Max vertex attribute stride unknown. Assuming it is 2048
Traceback (most recent call last):
  File "/media/astro/New Volume/Fastplotlib_Interactions/fastplotlib_testing.py", line 5, in <module>
    fig = fpl.Figure()
  File "/media/astro/New Volume/Fastplotlib_Interactions/venv/lib/python3.13/site-packages/fastplotlib/layouts/_imgui_figure.py", line 67, in __init__
    self._imgui_renderer = ImguiRenderer(self.renderer.device, self.canvas)
                           ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/media/astro/New Volume/Fastplotlib_Interactions/venv/lib/python3.13/site-packages/wgpu/utils/imgui/imgui_renderer.py", line 94, in __init__
    self._backend = ImguiWgpuBackend(device, render_target_format)
                    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/media/astro/New Volume/Fastplotlib_Interactions/venv/lib/python3.13/site-packages/wgpu/utils/imgui/imgui_backend.py", line 128, in __init__
    self._create_device_objects()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/media/astro/New Volume/Fastplotlib_Interactions/venv/lib/python3.13/site-packages/wgpu/utils/imgui/imgui_backend.py", line 192, in _create_device_objects
    self.create_fonts_texture()
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/media/astro/New Volume/Fastplotlib_Interactions/venv/lib/python3.13/site-packages/wgpu/utils/imgui/imgui_backend.py", line 146, in create_fonts_texture
    font_matrix = self.io.fonts.get_tex_data_as_rgba32()
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'imgui_bundle._imgui_bundle.imgui.ImFontAtlas' object has no attribute 'get_tex_data_as_rgba32'

Steps to reproduce:

  1. Create a new virtual environment with Python 3.13:

    python3 -m venv venv
    source venv/bin/activate
  2. Install fastplotlib with notebook and imgui support:

    pip install -U "fastplotlib[notebook,imgui]"
  3. Install imageio:

    pip install imageio
  4. Run the example script above with Python 3.

Environment:

  • OS: Ubuntu 24.04.2 LTS (Observed a similar issue on Windows as well, anaconda environment was used there)

  • Python: 3.13

  • fastplotlib version: 0.5.0

  • Could this be a compatibility issue with the version of imgui or imgui_bundle currently installed?

  • Would appreciate any pointers on required imgui versions or dependencies.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions