Open causeri3 opened 7 months ago
@tcaduser Could you possibly share some working code you used to develop the recipe?
Matplotlib Compatibility: Matplotlib is primarily designed for desktop environments and might not have full compatibility with iOS. Limited Graphics Acceleration: Kivy on iOS relies on OpenGL for rendering, but some features like Matplotlib plots might not be efficiently handled by the limited OpenGL support on iOS devices.
@causeri3 Can you try my project if it solve your issue: https://github.com/mp-007/kivy_matplotlib_widget My project used an other approach by using Agg backend. The rendering will be much faster.
You can used this working example:
from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
import os
import numpy as np
import matplotlib.pyplot as plt
from kivy_matplotlib_widget.uix.graph_widget import MatplotFigure
#or use this widget if you have multiple axis and not just lines
#from kivy_matplotlib_widget.uix.graph_subplot_widget import MatplotFigureSubplot
class MatplotlibApp(App):
def build(self):
print("app.directory = ", self.directory)
print("app.user_data_dir = ", self.user_data_dir)
layout = BoxLayout()
x = np.linspace(0, 10, 100)
y = np.sin(x)
fig, ax = plt.subplots()
ax.plot(x, y, label='sin(x)')
ax.set_xlabel('x')
ax.set_ylabel('sin(x)')
figure_widget = MatplotFigure()
figure_widget.figure = fig
layout.add_widget(figure_widget)
return layout
if __name__ == '__main__':
MatplotlibApp().run()
Can you run with the xcode debugger attached to your iphone and see if it crashes in the c code. I haven't worked with this recently, but I have had issues where I have needed to compile multiple times to get the code in a good state. I think there may be some caching issue between the IOS phone and phone simulator builds.
Please see here for a brief description of what I am encountering.
Will try later, right now https://download.savannah.gnu.org seems to be down.
Tbh, I gave up on matplotlib and visualize the data simplified with kivy widgets. The old XCode debugging logs from the build on my iPhone are above. For the moment, I keep on struggeling to get the App on TestFlight.
I can't get kivy running on my ios device with matplotlib. It freezes on my phone while I see the uploading screen.
MRE
My setup
Running
XCode gives me: