Graphics, Figures & Tables ⇒ Transverse Intensity Profile of a Laser Beam
Transverse Intensity Profile of a Laser Beam
I'm curious, if there is a way to realize a laser beam profile and its Gauss fit in the manner sketched in the uploaded files.
Thanks in advance
- Attachments
-
- image3.png (16.86 KiB) Viewed 8259 times
-
- traverse-int.JPG (2.79 KiB) Viewed 8259 times
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Transverse Intensity Profile of a Laser Beam
Code: Select all
\documentclass[11pt]{standalone}
\usepackage[T1]{fontenc}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[
scale=3,
samples=50,
declare function={mu=2;},
declare function={sigma=0.3;},
declare function={normal(\m,\s)=1/(2*\s*sqrt(pi))*exp(-(\x-\m)^2/(2*\s^2));}
]
\path[inner color=red] (1,1) rectangle (3,3);
\draw plot[domain=1:3] (\x,{normal(mu,sigma)});
\draw[rotate=90] plot[domain=1:3] (\x,{-normal(mu,sigma)});
\end{tikzpicture}
\end{document}
Thorsten
- Attachments
-
- ytmp.png (8.22 KiB) Viewed 8244 times
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: Transverse Intensity Profile of a Laser Beam
this looks really fantastic, thanks.
i have missed to say that i have the gaussian beam image done with a camera. i wanted to fit or put the bell-curve alongsides the image taken with the camera.
regards
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Transverse Intensity Profile of a Laser Beam
If it's not a secret, you could attach that picture (perhaps with reduced resolution) to your next post. And perhaps you could describe how this fit should look as well as where and how it should be placed.thinkpadT wrote:[…] i have missed to say that i have the gaussian beam image done with a camera. i wanted to fit or put the bell-curve alongsides the image taken with the camera. […]
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: Transverse Intensity Profile of a Laser Beam
hi,
the picture is indeed not a secret, and it is attached in my first post (the black and white picture "traverse-int.JPG") and the fits i wanted is drawn with MS paint and they are supposed to be Gaussian and they should be placed in positions showed in that picture.
Now i have the picture and the fit done separately. I wanted to placed them like in the picture. That would be one way i would like to have them
But if there was a way to use Latex, TikZ or pgf plot and do that in one code would be also a great thing.
regards
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Transverse Intensity Profile of a Laser Beam
That was not clear to me from your first post. The solution is still with TikZ/PGF. I have cut the picture to the relevant content and attached it to this post a well as the resulting output from the below code.thinkpadT wrote:[…] the picture is indeed not a secret, and it is attached in my first post (the black and white picture "traverse-int.JPG") and the fits i wanted is drawn with MS paint and they are supposed to be Gaussian and they should be placed in positions showed in that picture. […]
Code: Select all
\documentclass[11pt]{article}
\usepackage[T1]{fontenc}
\usepackage{tikz}
\pgfdeclareimage[height=4cm]{beam}{transverse-intensity}
\begin{document}
\begin{tikzpicture}[
scale=2,
samples=50,
declare function={mu=1;},
declare function={sigma=0.3;},
declare function={normal(\m,\s)=1/(2*\s*sqrt(pi))*exp(-(\x-\m)^2/(2*\s^2));}
]
\node at (1,1) {\pgfuseimage{beam}};
\draw plot[domain=0:2] (\x,{-normal(mu,sigma)});
\draw plot[domain=0:2,rotate around={90:(1,1)}] (\x,{-normal(mu,sigma)});
\end{tikzpicture}
\end{document}
- Attachments
-
- The resulting output.
- ytmp.png (4.68 KiB) Viewed 8190 times
-
- The used graphics file.
- transverse-intensity.png (2.11 KiB) Viewed 8190 times
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: Transverse Intensity Profile of a Laser Beam
thanks, that looks very nice. that's exactly what i need.
using your code i get the gaussian profiles but not the image(

regards
- Attachments
-
- result.PNG (30.83 KiB) Viewed 8172 times
- Johannes_B
- Site Moderator
- Posts: 4182
- Joined: Thu Nov 01, 2012 4:08 pm
Re: Transverse Intensity Profile of a Laser Beam
Concerning the image: Can you please provide us with more information, is there any error message?
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Transverse Intensity Profile of a Laser Beam
See Johannes' remarks. The exact code in form of a minimal example would be helpful (if it differs from my code sample). The code works for me. Hence there must be something that prevents its functionality on your machine.thinkpadT wrote:[…] using your code i get the gaussian profiles but not the image( :? doing something wrong): […]
Why do you come only bit by bit which such important information? We could have done this in one go right at the beginning. This will require a completely new approach. And there's another problem: It is weekend and very nice weather here. So don't expect a solution before Monday (from me).thinkpadT wrote:[…] An additional question: is there a possibilty to put axis boxes with some number around the image, for example as drawn in the image in red. […]
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10