3

I have a data with wavelength and intensity and I draw these graph with excel.wavelength- intensity graph

then how can i make this into specturm like below?spectrum

Szabolcs
  • 234,956
  • 30
  • 623
  • 1,263
SY Lee
  • 31
  • 2

1 Answers1

2

Here's an example with some generated sample data. You will need to adjust the colour function and the scaling of the data for your application. Here I used the builtin colour function ColorData["VisibleSpectrum"], which takes values between 380 and 750. You probably need to tweak this, since your range is 300 to 1000.

Sample data:

data = Table[{x, 
    Sum[Exp[-0.1 (x - mid)^2]/mid, {mid, {400, 500, 600}}]}, {x, 380, 
    750}];

ListLinePlot[data, PlotRange -> All]

Mathematica graphics

Rescale data, so intensities are between 0 and 1.

max = Max[data[[All, 2]]];
data = {#1, #2/max} & @@@ data;

Build a nice colour function:

cf = Blend[{Black, Blend[{White, ColorData["VisibleSpectrum"][#1]}]}, #2] &;

This has two parameters: the first one is the wavelength, the second is the intensity. The extra blending with White is to improve visibility.

ArrayPlot[{cf @@@ data}, AspectRatio -> 1/10, 
 PlotRangePadding -> None]

enter image description here

Szabolcs
  • 234,956
  • 30
  • 623
  • 1,263
  • my raw data is in my spread sheet : https://docs.google.com/spreadsheets/d/1KoDbffY32324vJJ08716fuLHVYi_lEh-cg4sIZViagU/edit?usp=sharing – SY Lee May 09 '17 at 13:21