Advertisement
Guest User

Untitled

a guest
Jul 1st, 2015
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. sTitle = 'trajectory';
  2. sFile = 'Data/trajectory.mat';
  3. sPdfFile = 'pdfs/trajectory.pdf';
  4.  
  5. fig = figure;
  6.  
  7. % Adjust figure window size
  8. set(fig, 'Position', [100 100 1400 800]);
  9.  
  10. % Set title
  11. title(sTitle);
  12.  
  13. % Get states
  14. [s, t] = load_data(some_data);
  15.  
  16. % Draw trajectory
  17. plot(s(1,:), s(2,:), 'linewidth', linewidth);
  18.  
  19. % Labels and stuff
  20. xlabel('x^W [m]', 'fontsize', fontsize1);
  21. ylabel('y^W [m]', 'fontsize', fontsize1);
  22. set(gca, 'fontsize', fontsize1)
  23.  
  24. % Axis font
  25. set( gca , ...
  26. 'FontName' , 'Helvetica' );
  27.  
  28. set(gca, ...
  29. 'Box' , 'on' , ...
  30. 'TickDir' , 'out' , ...
  31. 'TickLength' , [.02 .02] , ...
  32. 'XMinorTick' , 'on' , ...
  33. 'XGrid' , 'on' , ...
  34. 'XMinorGrid' , 'off' , ...
  35. 'YMinorTick' , 'on' , ...
  36. 'YGrid' , 'on' , ...
  37. 'XColor' , [.3 .3 .3], ...
  38. 'YColor' , [.3 .3 .3], ...
  39. 'XTick' , -5:1:5, ...
  40. 'XTickLabelMode', 'auto', ...
  41. 'YTick' , -5:1:5, ...
  42. 'LineWidth' , 1 );
  43.  
  44. % Adjust view
  45. axis([-2.5 2.5, -2.7 0.5]);
  46.  
  47. % Correct data aspect ratio
  48. daspect([1,1,1])
  49.  
  50.  
  51. % Print to PDF
  52. width = 10;
  53. height = 5;
  54. set(gcf, 'PaperPosition', [0 0 width height]); %Position plot at left hand corner with width 5 and height 5.
  55. set(gcf, 'PaperSize', [width height]); %Set the paper to have width 5 and height 5.
  56. print('-dpdf', '-r600', sPdfFile);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement