User Tools

Site Tools


matlab

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
matlab [2024/05/23 15:51] 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.
  
-  x=[0:1:50];+  x=[400:1:450];
   y=2*sin(x/5);   y=2*sin(x/5);
-  figure('units','centimeters','Position', [10 10 8.5 8.5]) %this makes a single-column figure (width 8.5cm+  figure('units','centimeters','Position', [10 10 8.5 8.5]) 
-  plot(x,y,'LineWidth',1.1); %linewidth 1.1 makes curve slightly thicker than default +  p=plot(x,y,'LineWidth',1.1); %make curve slightly thicker than default 
-  axis([0 50 0 3]) +  set(gca,'linewidth',1.1)  %make axis slightly lines thicker than default 
-  xlabel('wavelength, ')  +  axis([400 450 0 3]) 
-  ylabel('intensity' +  xlabel('wavelength, \lambda (nm)'%LaTeX notation for math symbols 
-  set(gca,'linewidth',1.1 %linewidth 1.1 makes axis slightly lines thicker than default +  ylabel('intensity (W/cm^2)') %LaTeX notation for superscript 
-  set(gca,'FontSize',10) %when the graph is scale to 8.5cm width, the font will be 10 point.+  set(gca,'FontSize',10) %10 point font when used as 8.5 cm figure.
      
 Additional pointers about graphs on Matlab. Additional pointers about graphs on Matlab.
-  *From the menus associated with the figure, go to "file > export setup > rendering", and set the resolution to 300 dpi ("apply to figure"). +  *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 > save as", and save as a png file. png is much better than jpg for line graphics.+  *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.1716504701.txt.gz · Last modified: 2024/05/23 15:51 by ethanminot