User Tools

Site Tools


matlab

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
matlab [2022/12/13 09:40] – created ethanminotmatlab [2024/05/23 15:58] (current) ethanminot
Line 3: Line 3:
 These lines of code help make a better looking plot that can be exported for a notebook or a publication. These lines of code help make a better looking plot that can be exported for a notebook or a publication.
  
-plot(x,y2,'LineWidth',1.8); %make curve thicker than default +  x=[400:1:450]; 
-axis([3 35 0 34]) +  y=2*sin(x/5); 
-set(gca,'linewidth',1.7)  %make axis lines thicker than default +  figure('units','centimeters','Position', [10 10 8.5 8.5]) 
-xlabel('wavelength')  +  p=plot(x,y,'LineWidth',1.1); %make curve slightly thicker than default 
-ylabel('intensity')  +  set(gca,'linewidth',1.1)  %make axis slightly lines thicker than default 
-set(gca,'FontSize',26) %make text bigger than default+  axis([400 450 0 3]) 
 +  xlabel('wavelength, \lambda (nm)'%LaTeX notation for math symbols 
 +  ylabel('intensity (W/cm^2)'%LaTeX notation for superscript 
 +  set(gca,'FontSize',10) %10 point font when used as 8.5 cm figure. 
 +   
 +Additional pointers about graphs on Matlab. 
 +  *If your data is very big or very small, multiply the data by a scaling factor and note this scaling factor in the units. For example, rather than plot 1e-8 amperes, multiply by 1 billion and plot as 10 nA.   
 +  *From the menus associated with the figure, go to "file > export setup > rendering", and set the resolution to 300 dpi or 600 dpi ("apply to figure"). 
 +  *From the menus associated with the figure, go to "file > save as", and save as a png file. Choose png because it is much better than jpg for line graphics. 
matlab.1670953255.txt.gz · Last modified: 2022/12/13 09:40 by ethanminot