I was running a matlab code aiming to output a spectrum picture on the Supercomputer node. Maybe because it don't contain a GUI, the picture keeps posting me warnings and the output isn't right. I am pretty sure the code is right because I tested it on my PC and it's totally fine. but on supercomputer it can't output the lines drawed by surf(), the title, and the colorbar.
warning message:
Warning: An error occurred while drawing the scene: An error occurred while
rendering after the depth sort.
> In defaulterrorcallback (line 12)
In matlab.graphics.internal/mlprintjob/setPaintDisabled
In alternatePrintPath
In alternatePrintPath
In onCleanup/delete (line 25)
In alternatePrintPath
In print (line 90)
In saveas (line 181)
In process_all_files (line 33)
Warning: An error occurred while drawing the scene: Unidentified trouble during
rendering
> In defaulterrorcallback (line 12)
In matlab.graphics.internal/mlprintjob/setPaintDisabled
In alternatePrintPath
In alternatePrintPath
In onCleanup/delete (line 25)
In alternatePrintPath
In print (line 90)
In saveas (line 181)
In process_all_files (line 33)
wrong output picture:
figure code:
time_axis = (pace:pace:loop * pace);
[X, Y] = meshgrid(xaxis, time_axis);
fig = figure('Visible', 'off');
surf(X, Y, spectrum, 'EdgeColor', 'none');
fig = figure('Visible', 'off');
fig = figure('Visible', 'off');
waterfall(X, Y, spectrum);
zlabel('Amplitude (dB)');
error('Invalid picture style.');
title(['Spectrum Result of ', timestamp]);
xlabel(sprintf('Frequency (Hz)\nSample rate: %.2f Hz, Time: %.2f s', fs, time));
the code is a part in a function which returns fig variable, and the main program catches the fig variable and use saveas() to save it as .svg file.
saveas code:
returnfig=processingxx(iq_file, xml_file);
saveas(returnfig, fullfile(result_dir, append(timestamp, '-0.1s','.svg')), 'svg');