GameObject graph = GameObject.Find("/Canvas/Graph"); RectTransform textRect = graph.GetComponent<RectTransform>(); textRect.sizeDelta = new Vector2(1000.0f, 1000.0f);