~~NOTOC~~ ====== General Instructions for Creating Graphs and Figures ====== Examples below can be generated by ''plot_example.m'' script in [[http://cw.felk.cvut.cz/courses/GVG/2013/Tools|Tools repository]]. * Use ''subfig'' to place your figures reasonably. Note that a new figure is created each time, so don't forget to close your figures. Preferably ''close all'' at the beginning of your script. * Each figure should a have descriptive title. * When necessary, a legend describing lines of different colors/styles should be added, preferably inside the plot, if possible. ==== Figures with Bitmap Image Superimposed ==== * Do not use ''imshow'' Matlab command for displaying bitmaps. Use ''image'' (or ''imagesc'' for grayscale bitmaps), then axes are kept shown. * Ensure square pixels: ''axis image'' (this hides area outside the image) or ''axis equal''. | {{courses:gvg:labs:ex_img.png|Example image}} | ==== 2D and 3D Euclidean Plots ==== * Ensure equal axis scale: ''axis equal'' * Use labels for axes, e.g. ''xlabel( 'x' )'', ''zlabel( 'z' )'' | {{courses:gvg:labs:ex_3d.png|Example 3D Plot}} | ==== Plotting vectors ==== * Use ''quiver'' and ''quiver3'' to plot bound vectors in 2D/3D. * Use as ''quiver(X,Y,U,V,0)'' where X,Y is the origin and U,V the vector. The scaling argument 0 ensures the arrow is of the proper length. | {{courses:gvg:labs:random2CS.png|Example vector plot}} | ==== Other Graphs ==== * Use labels for axes, e.g. ''xlabel( 'time [s]' )'', ''ylabel( 'voltage [mV]' )''. Don't forget units. * Use ''axis tight'' to set axis limits tightly to data. | {{courses:gvg:labs:ex_graph.png|Example graph.}} |