Empty figure window when plotted from Python
Hi,
I tried to plot a MATLAB figure using a MATLAB funciton from Python script.
I used the following MATLAB funtion (plot_test.m) to draw a simple line graph:
function h = plot_test()
clear; close all;
h = plot(1:10, 2:11, ‘o:’)
grid on;
end
I called the MATLAB funciton from Python (plot_test.py):
import matlab.engine
eng = matlab.engine.start_matlab()
h = eng.plot_test()
input("Press Enter to quit…")
eng.quit()
The MATLAB figure window was opened. But it was empty.
Could you help me?
The system environments are as follows:
MATLAB: R2023b
Python: 3.11.8
OS: Fedora Linux 6.8.6-100.fc38.x86_64
Shell: bash 5.2.26
Resolution: 1680×1050
Gnome:44.1
I suspect that the resolution might have some impact on this result because when I run the same code in another Fedora machine with 1920×1080 monitor, it shows the graph.Hi,
I tried to plot a MATLAB figure using a MATLAB funciton from Python script.
I used the following MATLAB funtion (plot_test.m) to draw a simple line graph:
function h = plot_test()
clear; close all;
h = plot(1:10, 2:11, ‘o:’)
grid on;
end
I called the MATLAB funciton from Python (plot_test.py):
import matlab.engine
eng = matlab.engine.start_matlab()
h = eng.plot_test()
input("Press Enter to quit…")
eng.quit()
The MATLAB figure window was opened. But it was empty.
Could you help me?
The system environments are as follows:
MATLAB: R2023b
Python: 3.11.8
OS: Fedora Linux 6.8.6-100.fc38.x86_64
Shell: bash 5.2.26
Resolution: 1680×1050
Gnome:44.1
I suspect that the resolution might have some impact on this result because when I run the same code in another Fedora machine with 1920×1080 monitor, it shows the graph. Hi,
I tried to plot a MATLAB figure using a MATLAB funciton from Python script.
I used the following MATLAB funtion (plot_test.m) to draw a simple line graph:
function h = plot_test()
clear; close all;
h = plot(1:10, 2:11, ‘o:’)
grid on;
end
I called the MATLAB funciton from Python (plot_test.py):
import matlab.engine
eng = matlab.engine.start_matlab()
h = eng.plot_test()
input("Press Enter to quit…")
eng.quit()
The MATLAB figure window was opened. But it was empty.
Could you help me?
The system environments are as follows:
MATLAB: R2023b
Python: 3.11.8
OS: Fedora Linux 6.8.6-100.fc38.x86_64
Shell: bash 5.2.26
Resolution: 1680×1050
Gnome:44.1
I suspect that the resolution might have some impact on this result because when I run the same code in another Fedora machine with 1920×1080 monitor, it shows the graph. python, figure MATLAB Answers — New Questions