First - to paste code to the web site, right click and select paste as plain text, that will preserve the formatting.
The issue. You are trying to access the ids dict in __init__ the ids dict is created when kv is processed use the event on_kv_post()
See: https://kivy.org/doc/stable/api-kivy.uix.widget.html?highlight=on_kv_post#kivy.uix.widget.Widget
Additionally the graph is on a screen (self.parent) each screen has an attribute that contains the screen manager.
So self.parent.manager will point to the screenmanager
To access a screen you use the get_screen(‘name’) of the ScreenManager… or
self.parent.manager.get_screen(‘second’).ids.graph_screen
Let me know if that solves your issue.
--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/84eda10d-8604-493f-b782-0fa05244cecbn%40googlegroups.com.

If you still have an issue, Share your code, properly formatted.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/952664eb-6e83-4a18-8392-ab594898621an%40googlegroups.com.
Make the highlighted change below to your code. I commented out a few things because I did not have some packages installed.
Replace the Label in the highlighted code with your graph.
Description: You have instanced the Graph class, in kv on the second screen. You need to add the plot to that class (or self in Graph).
import kivy
from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.screenmanager import ScreenManager, Screen
from kivy.lang import Builder
from kivy.uix.label import Label
from kivy.metrics import dp, sp
from kivy.clock import Clock
# Graphical Imports
# from kivymd.app import MDApp
# from kivy.garden.matplotlib.backend_kivyagg import FigureCanvasKivyAgg
# import matplotlib.pyplot as plt
x = [1, 2, 3, 4, 5]
y = [5, 14, 7, 20, 11]
# plt.plot(x, y)
# plt.ylabel("y axis")
# plt.xlabel("x axis")
class WelcomeScreen(Screen):
pass
class FirstScreen(Screen):
pass
class SecondScreen(Screen):
pass
class ScreenManager(ScreenManager):
pass
class Graph(FloatLayout):
def __init__(self, **kwargs):
super().__init__
(**kwargs)
self.add_widget(Label(text='Graph goes here'))
def save(self):
pass
class Project(BoxLayout):
pass
kv = Builder.load_file("mix.kv")
class TestApp(App):
title = "Kivy Project"
def build(self, **kwargs):
return Project()
if __name__ == '__main__':
TestApp().run()
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/cc6c02f9-3bf1-43bb-8808-65f5dc93a740n%40googlegroups.com.
You are using a FloatLayout, a float layout positions it’s children relative to the Window coordinates. You are putting your graphs on top of one another.
You can change the Graph to be a Relative Layout and put 2 graphs in BoxLayout on the Screen.
class Graph(RelativeLayout):
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.add_widget(Label(text='Graph goes here'))
def save(self):
pass
and in kv:
<SecondScreen>:
id: second
name: 'second'
BoxLayout:
orientation: 'vertical'
Graph:
Graph:
Looking at Graph, I would be inclined define Graph as a BoxLayout.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/272ac69f-489e-47bc-91db-9ba5ef9159b0n%40googlegroups.com.