A program to recognize and reward our most engaged community members
Is it possible save the Compose plot result into pdf file? (Compose Ver. 2017.3)
- Save the plots into a PDF
we don’t support creating of PDF and PPTX from COMPOSE OML in 2017.3, these features are coming up in next releases. We can leverage COMPOSE – Python (2way bridge) to accomplish this task.
below are the steps with example:
for i =1:10
f=figure(i);
plot(rand(1,100));
saveas(f, ['demo',num2str(i),'.png']);
end
outfile = 'mypdf.pdf';
exporttopython('outfile','outfile');
evalpythonfile('python_pdf.py'); % comments are added in the file for better understanding.
Hope this helps.
<?xml version="1.0" encoding="UTF-8"?>
Unable to find an attachment - read this blog
Thank you, Manoj
I tried to change picture format wit 'bmp'.
So I changed 'png' to 'bmp' in both oml file and py file.
But it makes error.
I want better resolution rather then png.
Can you help me about this? ; use 'bmp' picture format.
Hi Seoksan,
The fpdf python library support jpg, png but not bmp. we can use 'pillow' library to save .bmp to pdf
below is the sample example script that can save the .bmp files in a pdf