Posts

Showing posts from July, 2014

How to use Latex mode in matlab

How to use Latex mode in matlab Add the following lines to you code. When you see the file it would look wired but when you see the saved figure you will find everything in place. Remember you have to save the figure in "eps" of  "pdf " format only.     %Program to show how to use Latex mode in matlab x = linspace(1,100,1000); plot(x,sin(x)) text(40,0,'$\bar{Q}$','FontSize',20,'Interpreter','latex') xlabel('$\bar{Q}$','FontSize',20,'Interpreter','latex') ylabel('$\bar{Q}$','FontSize',20,'Interpreter','latex') %One can use "\overline" instead of "\bar", because it's looking pretty good. %text(40,0,'$\overline{Q}$','FontSize',20,'Interpreter','latex') %You can use this also it's pretty good saveas(gcf,'a','epsc') %You can also use 'pdf' to save the figure in "pdf"