Automatically print 16 thumbnail graphs

1 view (last 30 days)
BGC
BGC on 31 Aug 2013
I need to embed in a program the ability to produce 16 small graphs and then print them on a single A4 page. Should be simple but nothing that I have tried works! However when I use printpreview and manually select 'fill page' and then print, that works. The sample program is below;
% Test program to plot out 16 thumbnail graphs on a single A4 sheet of paper % Program DOES NOT WORK! It prints axes much as are seen on the screen % but NOT the whole graph. The X and Y arrays are an attempt to locate % where the plots should sit on the paper. However if I use printpreview, % select fill page and then print, printing gives me what I want. % obviously I want to use this to print out thumbanail view of around 200 % files for visual comparison
figure(100) set(gcf, 'PaperType', 'A4') set(gcf, 'PaperOrientation', 'portrait') set(gcf, 'PaperUnits', 'centimeters') set(gcf, 'PaperSize', [20.98 29.68]) file='dummy file'; X=[3 12 3 12 3 12 3 12 3 12 3 12 3 12 3 12]'; Y=[24 24 21 21 18 18 15 15 12 12 9 9 6 6 3 3]'; data=[1:99]; % This is just dummy data to test the thumbnail print nprint=0; for i=1:32 nprint=nprint+1 set(gcf, 'Position', [X(nprint) Y(nprint) 6.5 2.0]) subplot(8,2,nprint), plot(data) xlabel(file) if nprint==16 print -dwinc -f100 %printpreview(100) % This works if 'fill plot' selected pause clf nprint=0; end end
Would greatly appreciate anyone's help to resolve this
  1 Comment
per isakson
per isakson on 31 Aug 2013
Edited: per isakson on 1 Sep 2013
  • Markup the text. Try the buttons, {}Code and ?Help.
  • Are there any warning or error messages?

Sign in to comment.

Answers (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!