Borrar filtros
Borrar filtros

Vertical lines on a graph from a CSV

1 visualización (últimos 30 días)
Nathan Kennedy
Nathan Kennedy el 5 de Abr. de 2017
Comentada: KSSV el 6 de Abr. de 2017
Hi,
I have a CSV file that has many elements and their emission line at a specific wavelength. On my graph I want to draw all these straight vertical lines for each element. The graph is Wavelength against intensity.
I currently am able to manually enter in each line using
Lyman_alpha = vline(937.06,'r','Lyman Alpha')
Where 937.06 is the wavelength and r makes the line red.
However I have over 60 emission lines to place on my graph, is there anyway this can be done with a few lines of code? I tried this but failed miserably
emissionlines =csvread('emissionlines.csv');
element = emissionlines(:, 1);
wavelengthEmission = emissionlines(:, 2);
element[i] = vline(wavelengthEmission[i],'r','element[i]') <--- Fails here
findpeaks(SFD,wavelength,'Threshold',6)
PS. I'm new to MATLAB.
  1 comentario
KSSV
KSSV el 6 de Abr. de 2017
try
hh = vline(wavelengthEmission[i],'r','element[i]')

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Bar Plots en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by