![gcf matlab 2017 gcf matlab 2017](https://interfacegroup.ch/content/uploads/2016/04/figure2_text.png)
Which will produce and save the following plot, > saveas(gcf,'sinCosDecoratedScatter.png') > title('A simple plot of Sin(x) and Cos(X)', 'fontsize', 12) For example you could add a plot title as well as X-axis and Y-axis labels to your plots by, > title('A simple plot of Sin(x) and Cos(X)', 'fontsize', 12)Īlso we could add legends to the plot, explaining what each line represents, > legend(, 'fontsize', 13, 'location', 'southwest' ) Nevertheless, here are a few useful commands that help you decorate your plots. Things you can do with MATLAB plotting functions is virtually endless, and there is no way we could cover all of them here in this course. This will save the following figure for you, on your local device,Īnnotating and decorating your MATLAB plots If you wish to add new data to this plot, you could use hold on command, > hold on Here, gcf refers tothe current figure handle in MATLAB environment.
![gcf matlab 2017 gcf matlab 2017](https://1.bp.blogspot.com/-gCnOYQY-jV8/WX6h1fp7sFI/AAAAAAAAAFU/mEGVL2TzVqEJfwGWQvB4MxYpWHbfDcBcgCLcBGAs/s1600/fig2.jpg)
You could also save this figure in almost any format you wish using save() function, > saveas(gcf,'sin.png') This will open the following MATLAB figure page for you in the MATLAB environment, All you need to have is a dataset consisting of X and Y vectors, > X = 0:0.1:10 With this function, plotting x-y data is as simple as it can be. One of the most widely used MATLAB plotting functions is plot(). Here in this lecture, we will only review some of the most important and most useful plotting capabilities in MATLAB. MATLAB is truly the unique best language for plotting data, and in my personal view, no other language comes even close to it (except perhaps, the R programming language which is specifically designed for data analysis and plotting). One of the most useful methods of outputting the results of your research and MATLAB projects is plotting.