%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % pgf-spectraManual documentation % the manual is not optimized, made by «chunks» % to carry out the development of the package % some 'images' was made with separated files % with the preview package... %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \documentclass[a4paper,10pt,oneside,openany,fleqno]{article} \usepackage[LSE]{pgf-spectra} \usepgfspectralibrary{data,pgfplots,rainbow,tempercolor}% \usetikzlibrary{fadings} %\usepackage{pgfplots} %\usepgfplotslibrary{fillbetween} %\pgfplotsset{width=7cm,compat=1.17} \usepackage{calc} \usepackage[english]{babel} \addtolength{\textwidth}{3.5cm} \addtolength{\textheight}{2.5cm} \addtolength{\topmargin}{-1.25cm} \setlength{\parindent}{0pt} \setlength{\oddsidemargin}{0pt} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \def\version{3.0.1}% \def\inversion#1{#1}% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \usepackage[pdfstartview={ },colorlinks=true, linkcolor=black!50!green, citecolor=gray, urlcolor=teal, hyperindex, plainpages=false,bookmarksopenlevel=1,bookmarksopen=true]{hyperref}% \hypersetup{%Start options on pdf pdftitle = {Manual for pgf-spectra (v\inversion{3.0.1})},% pdfsubject = {Emission and absorption lines of the elements},% pdfkeywords = {Draw the spectrum of elements in a simple way via pgf/TikZ environment. It's possible to draw a desired spectrum, continuous or discrete.},% pdfauthor = {\textcopyright Hugo Gomes},% %pdfcreator = {\LaTeX\ with package \flqq hyperref\frqq}, pdfproducer = {pdfeTeX-1.\the\pdftexversion\pdftexrevision}, }%End options on pdf \usepackage[ansinew]{inputenc} \usepackage{verdana} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsmath} \usepackage{fancyhdr} \usepackage{lastpage} \renewcommand{\headrulewidth}{0.4pt}% \renewcommand{\footrulewidth}{0.4pt}% \addtolength{\headheight}{25pt}% \fancypagestyle{pgfSpectraManual}{% \fancyhf{} % clear all header and footer fields \fancyhead[R]{\nouppercase{\leftmark}}% \fancyhead[L]{\color{blue}pgf-spectra \version}% \fancyfoot[R]{\textbf{\thepage\ of \pageref{LastPage}}}% \fancyfoot[L]{\ }}% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \input{pgf-spectraManual_defs.tex}% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \title{Manual for pgf-spectra \version} \author{Hugo Gomes\\ \texttt{hugo.parelho@gmail.com}} \date{\today} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{document}% \vfill \begin{titlepage} \maketitle\thispagestyle{empty}% \begin{center}%\pgfspectra[element={Hg},charge=all,back=visible40,gamma=.6] \pgfspectra[element=Hg,axis,axis step=50,begin=100,end=1100,back=visible40,gamma=.6,line width=.5pt] \\ \footnotesize\textsf{\txtspecopt[element=Hg,axis,axis step=50,begin=100,end=1100,back=visible40,gamma=.6,line width=.5pt]} \end{center} \vfill \makebox[\linewidth][c]{\tikz{% \node[text width=.9\linewidth+.5cm,text justified,draw=blue!25!black,rounded corners=10pt,fill=blue!10] at (0,0) {\color{blue!25!black} \begin{abstract} \noindent The purpose of this package is to draw the spectrum of elements in a simple way. It's based on the package \textit{pst-spectra}, but with some extra options. It relies on pgf/\textrm{Ti\textit{k}Z} to draw the desired spectrum, continuous or discrete. As in \textit{pst-spectra} there is data available for the spectra of 98 elements and their ions. It also allows the user to draw a spectrum with their own custom data. \\ [4pt]The lines data extends from Extreme UV to Near IR ($10\,nm\leq\lambda\leq4\hspace{.05pt}000\,nm$). \textit{See section \hyperlink{sec:data}{The lines data} below for more information.} \\ [4pt]It is possible to redshift the lines of a spectrum, by directly entering the redshift value or the velocity and the angle to compute the redshift value (Doppler Redshift). \\ [4pt]Spectral lines data can be presented in a table or exported to a file. \\ [4pt]This package also provides color conversion (correlated color temperature), shadings for use with \txttikz{} and/or \txtPGFPLOTS{} and color maps for use with \txtPGFPLOTS{}. \\ [6pt] \end{abstract} };}} \vfill\vfill\vfill\vfill \end{titlepage} \newpage% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \pagestyle{empty}% \pdfbookmark[1]{Table of contents}{pdfContents}% \tableofcontents% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \newpage\setcounter{page}{1}% \pagestyle{pgfSpectraManual} \ \vfill \section{Installation and usage} \noindent \pack{} is placed under the terms of the \LaTeX{} Project Public License, version 1.3 or later (http://www.latex-project.org/lppl.txt). \pack{} loads and only requires the package \href{https://www.ctan.org/pkg/pgf}{\txttikz{}}. \\ [6pt]You need to put the style file (pgf-spectra.sty) in a location where \texttt{\large PDF}\LaTeX{} can find them. According to the TDS conventions this may be a subdirectory named tex/latex/pgfspectra/ or tex/latex/misc/ in your (site specific) installation tree (insert your appropriate directory delimiter instead of /, if needed). \\ [6pt]If you are using \texttt{\large PDF}\LaTeX{}, just can simply include the style file without any option via the \large\verb|\usepackage|\normalsize\ command, \large\verb|\usepackage{pgf-spectra}|\normalsize \\ [6pt]It can also be loaded with \textit{one option} to select the data source:\\ \large\verb|\usepackage[option]{pgf-spectra}|\normalsize \\ [6pt]\textit{\bfseries For more detailed information see section \hyperlink{sec:data}{The lines data}.} \vfill\vfill\vfill\newpage %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{What's new} \vspace{-32pt}\ \subsection*{}{\normalfont\large\bfseries\raisebox{1.25pt}{$\mathbf{\blacktriangleright}$}\ In version 3.0.1}% \addcontentsline{toc}{subsection}{In version 3.0.1}% \begin{itemize} \item Fixed a small bug dealing with the \red{axis label}/\red{axis label text} background color, which occurred when setting a \textit{visible background} with the \red{back} key, e.g.:\\ \resizebox{\linewidth}{\height}{\bs{pgfspectra}\lp\red{element=H,axis label text=\{wavenumber in nanometer\},back=visible50}\rp} \end{itemize} \vspace{-32pt}\ \subsection*{}{\normalfont\large\bfseries\raisebox{1.25pt}{$\mathbf{\blacktriangleright}$}\ In version 3.0.0}% \addcontentsline{toc}{subsection}{In version 3.0.0}% \begin{itemize} \item In the \txtspec{} command, syntax for the key \textit{lines} has been updated: it is now possible to specify a continuous range using \textit{start wavelength to end wavelength}, for instance, lines=\{380 to 500\} or lines=\{380 to 500,633\} or lines=\{633,555,380 to 500\}. \item New keys for \txtspec: \begin{itemize} \item axis label \item axis label text \item axis label position \end{itemize} \item New command \txtcomname{usepgfspectralibrary} for loading pgf-spectra libraries. \item New library \textit{data} to load spectral lines data, display it in a table or export it to a file. This library provides the commands: \begin{itemize} \item\txtcomname{pgfspectradata} to load the desired data. \item\txtcomname{pgfspectratable} displays loaded data in a table. \item\txtcomname{pgfspectrawrite} writes loaded data to a file. \end{itemize} \item Some commands from previous versions have been moved to new libraries: \begin{itemize} \item\txtcomname{pgfspectraplotshade} and \txtcomname{pgfspectraplotmap} moved to new library \textit{pgfplots}. \item\txtcomname{tempercolor} moved to new library \textit{tempercolor}. \item\txtcomname{pgfspectrarainbow} moved to new library \textit{rainbow}. \end{itemize} \end{itemize} \vspace{-32pt}\ \subsection*{}{\normalfont\large\bfseries\raisebox{1.25pt}{$\mathbf{\blacktriangleright}$}\ In version 2.2.0}% \addcontentsline{toc}{subsection}{In version 2.2.0}% \begin{itemize} \item LSE data \textit{renormalized} to lower values within \TeX{} capabilities.\\ This prevents \texttt{\large Dimension too large} errors and subsequent errors in spectrum drawing when using the \textcolor{red!50!black}{relative intensity} key. \item Added maximum intensities in IR, visible an UV ranges for both data sources (NIST and LSE). Now, when using the \textcolor{red!50!black}{relative intensity} key, the interval of wavelengths is detected and the respective maximum intensity is used. For example, if the spectrum is within the visible range, say between 400 and 700 nanometers, the maximum visible intensity will be used. The same is true for ranges only in IR or UV ranges. But, if the spectrum to be drawn is in more than one region -- for example, from 300 to 1000 or from 400 to 1000 or from 300 to 700 nanometers -- the maximum intensity that will be used is defined as the maximum intensity of all data. \item Fixed some typos in the manual. \end{itemize} \vspace{-32pt}\ \subsection*{}{\normalfont\large\bfseries\raisebox{1.25pt}{$\mathbf{\blacktriangleright}$}\ In version 2.1.1}% \addcontentsline{toc}{subsection}{In version 2.1.1}% \begin{itemize} \item Code rewrote for the command \txtplotshadename, supporting two new keys: \begin{itemize} \item shade begin \item logarithmic% \end{itemize} \end{itemize} \vspace{-32pt}\ \subsection*{}{\normalfont\large\bfseries\raisebox{1.25pt}{$\mathbf{\blacktriangleright}$}\ In version 2.1.0}% \addcontentsline{toc}{subsection}{In version 2.1.0}% \begin{itemize} \item The continuous visible region is now drawn via \txttikz{} shading, improving a little bit the speed of the whole process. \item Minor fix: the width of the emission/absortion lines are now correctly drawn. \item New keys for \txtspec: \begin{itemize} \item use visible shading \item backVIS \item axis unit \item axis unit precision \end{itemize} \item New color conversion command, which converts a temperature in Kelvin to the correspondent rgb color, based on correlated color temperature: \begin{itemize}\item\txttempercolor{temperature in Kelvin}\end{itemize} \item New commands that provides shadings to use in \txttikz{}: \begin{itemize} \item\txtshade% \pgfspectrashade[type=](start,end){name} ---> type: h-horizontal (default) | v-vertical \item\txtrainbow% \pgfspectrarainbow[](,,,,){radius} \\ [6pt]The \txttikz{} keys that affect the rainbow are: \begin{itemize} \item color\item opacity\item scope fading \end{itemize} The specific rainbow options are: \begin{itemize} \item rainbow fade%default={},% -> applies a scope fading in clipped region \item rainbow start%default=.6,% -> 60% \item rainbow knock out%default=.4,% -> 40% \item rainbow background%default=blue,% \item rainbow transparency%default=0 \end{itemize} \end{itemize} \item New command that provides a shading to use in \href{https://ctan.org/pkg/pgfplots}{\txtPGFPLOTS{}}: \begin{itemize} \item\txtplotshade\ % \pgfspectraplotshade{name} or with the following specific keys% \pgfspectraplotshade[options]{name} \begin{itemize} \item shade end%default=780,% minimum value 381 \item shade opacity%default=1,% \item shade opacity color%default=white% \end{itemize} \end{itemize} \item New command that builds a color map to use in \txtPGFPLOTS{}: \begin{itemize} \item\txtplotmap% \pgfspectraplotmap[]{name} % l -> low resolution (51 colors -> 380 to 780 nm ; step 8 nm) ! Default % h -> high resolution (401 colors -> 380 to 780 nm ; step 1 nm) \end{itemize} \end{itemize} \vspace{-32pt}\ \subsection*{}{\normalfont\large\bfseries\raisebox{1.25pt}{$\mathbf{\blacktriangleright}$}\ In version 2.0.0}% \addcontentsline{toc}{subsection}{In version 2.0.0}% \begin{itemize} \item The package can now be loaded with one of the following options: \begin{itemize} \item {\large\verb|\usepackage[NIST]{pgf-spectra}|} (\textbf{\small default}) \item {\large\verb|\usepackage[LSE]{pgf-spectra}|} \end{itemize} \item Range of spectral window from $10\,nm$ to $4000\,nm$ (previous version from $380\,nm$ to $780\,nm$). \item Added the lines data outside the visible range for the 98 elements. \item No more dependency on the package \textsf{\large ifthen} (code rewritten with the \textsf{\textbackslash\large\ ifx} \TeX\ primitive). \item Setting/disabling global options to draw the spectra's with the new commands: \begin{itemize} \item \txtspecstyle[options] \item \txtspecstylereset \end{itemize} \item New keys: \begin{itemize} \item axis ticks \item backIRUV (only for emission spectrum) \item IRcolor (for emission lines and for background in absorption spectrum) \item UVcolor (for emission lines and for background in absorption spectrum) \item redshift \item show redshift value \end{itemize} \item The issues with the zooming of the pdf viewer sometimes introducing blank lines in the spectra have been fixed: \\ [2pt]\makebox[\linewidth][c]{\includegraphics[width=.9\linewidth]{figsManual/linesOld.jpg}}% \\ [2pt]The rendition should now be working for every zoom (I hope!): \\ [2pt]\makebox[\linewidth][c]{\pgfspectra[width=.9\linewidth]}% \\ [8pt]\makebox[\linewidth][r]{\small\color{purple}Many thanks to \textit{Daniel García}\/'s suggestion to solve this problem!} \item Fixed the problem when putting the spectra inside any horizontal \TeX\ box, like \textsf{\large\textbackslash makebox}, \textsf{\large\textbackslash mbox} or \textsf{\large\textbackslash hbox}. \\ [3pt]For instance, the code \textsf{\large\textbackslash makebox[\textbackslash textwidth][c]\{\txtspecopt[element=He]\}}: \begin{itemize} \item had as a result in the previous version (version 1.0): \\ [3pt]\includegraphics{figsManual/pgfspectraV10badBox.pdf} \item and will result in version 2.0.0 at: \\ [3pt]\includegraphics{figsManual/pgfspectraV200goodBox.pdf} \end{itemize} \end{itemize} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \newpage \section{The lines data} \hypertarget{sec:data}{There are} two data sets availbale for drawing the spectra: one based in the previous version, whose data was initially obtained from the package \href{https://www.ctan.org/pkg/pst-spectra}{\textsf{pst-spectra}} and the other obtained from \href{https://physics.nist.gov/PhysRefData/Handbook/Tables/findinglist.htm}{NIST}. \\ [12pt]\tikz{\node[text width=\linewidth-12mm,draw=green!70,rounded corners=2pt,fill=black!10!green!10,inner sep=6mm,text justified] {In both cases are included the lines for 98 elements, from hydrogen ($Z=1$) to eins\-teinium ($Z=99$), except for francium ($Z=87$). For each element there are lines between $10\,nm$ and $4000\,nm$ (obtained from the referred pages at February 2021).};} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \subsection{Data based on pst-spectra} \tikz{\node[text width=\linewidth-4mm,draw=teal,rounded corners=2pt,fill=black!10,inner sep=2mm,text centered] {This set was obtained from \href{http://cdsarc.u-strasbg.fr/viz-bin/Cat?VI/16}{http://cdsarc.u-strasbg.fr/viz-bin/Cat?VI/16}};} \\ [10pt]According to the information on the page the listed lines are based on "Line Spectra of the Ele\-ments", Joseph Reader and Charles H. Corliss CRC Handbook of Chemistry and Physics. This book refers that «The table contains the outstanding spectral lines of neutral ($I$) and singly ionized ($II$) atoms of the elements from hydrogen through plutonium ($Z=1-94$); selected strong lines from doubly ionized ($III$), triply ionized ($IV$), and quadruply ionized ($V$) atoms are also included.» \\ [6pt]\makebox[66pt][s]{}\begin{minipage}{\linewidth-66pt}\color{black!70}\small Note: pst-spectra documentation refers "\textit{Line Spectra of the Elements from the Astronomical Data Center of NASA}" as the source material, but I'm assuming the original source is "\textit{Line Spectra of the Ele\-ments}"\textit{, Joseph Reader and Charles H. Corliss CRC Handbook of Chemistry and Physics}, obtained from \href{http://cdsarc.u-strasbg.fr/viz-bin/Cat?VI/16}{http://cdsarc.u-strasbg.fr/viz-bin/Cat?VI/16}.\end{minipage} \\ [12pt]\tikz{\node[text width=\linewidth-4mm,draw=purple,rounded corners=2pt,fill=black!10!purple!10,inner sep=2mm,text justified] {To use this data set load the package \pack{} with the option \verb|LSE| (acronym to Line Spectra of the Elements):% \\ [6pt]\large\color{purple}\verb|\usepackage[LSE]{pgf-spectra}|\\ [6pt]\small\color{orange}\hfill Number of lines provided: 46065 (see file pgf-spectraDataLSE.pdf)};} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \subsection{Data based on NIST} \tikz{\node[text width=\linewidth-4mm,draw=teal,rounded corners=2pt,fill=black!10,inner sep=2mm,text centered] {This set was obtained from \href{https://physics.nist.gov/PhysRefData/Handbook/Tables/findinglist.htm}{https://physics.nist.gov/PhysRefData/Handbook/Tables/findinglist.htm}};} \\ [10pt]According to the information on the page the listed lines «includes data for the neutral and singly-ionized atoms». \\ [6pt]\makebox[66pt][s]{}\begin{minipage}{\linewidth-66pt}{\color{black!70}\small Note: \textbf{This set is loaded by default}. Because the data to search is slightly smaller (only neutral and singly-ionized atoms) the time consumption when building the spectra could be a bit lower.}\end{minipage} \\ [12pt]\tikz{\node[text width=\linewidth-4mm,draw=purple,rounded corners=2pt,fill=black!10!purple!10,inner sep=2mm,text justified] {To use this data set load the package \pack{} without options: \\ [6pt]\large\color{purple}\verb|\usepackage{pgf-spectra}|\\ [6pt]\small\color{orange}\hfill Number of lines provided: 11980 (see file pgf-spectraDataNIST.pdf);}} \newpage %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{Commands overview} \hypertarget{sec:com}{The} \textit{main} commands, those always available, are: \begin{itemize} \item\txtspec{} or \txtspecopt[options list] \item\textcolor{blue!50!black}{\textbackslash wlcolor\{}\textcolor{red!50!black}{wavelength}\textcolor{blue!50!black}{\}} \item\txtspecstyle[options] \item\txtspecstylereset \item\txtshade%\\ [4pt]\textit{This command can be used with }\txttikz{}. \item\txtcomname{usepgfspectralibrary}\lb\red{name(s)}\rb \end{itemize} The commands available after loading libraries are:% to use with : \begin{itemize} \item\txtcomname{pgfspectradata}\lp\red{name of data set}\rp\lb\red{keys}\rb\hfill(\textit{data} library) \item\txtcomname{pgfspectratable}\lp\red{table options}\rp\lb\red{name(s) of data set(s)}\rb\hfill(\textit{data} library) \item\txtcomname{pgfspectrawrite}\lp\red{filename}\rp\lb\red{name(s) of data set(s)}\rb\hfill(\textit{data} library) \item\txtplotshade \hfill(\textit{pgfplots} library) %\\ [4pt]\textit{This command is to be used with }\txtPGFPLOTS{}. \item\txtplotmap \hfill(\textit{pgfplots} library) %\\ [4pt]\textit{This command is to be used with }\txtPGFPLOTS{}. \item\txttempercolor{Kelvin} \hfill(\textit{tempercolor} library) \item and finally \textit{just for fun} a command that draws a rainbow,\\ [4pt]\txtrainbow\hfill(\textit{rainbow} library) \end{itemize} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \vspace{-32pt}\ \subsection*{}{\normalfont\large\bfseries\raisebox{1.25pt}{$\mathbf{\blacktriangleright}$}\ Utilization of \txtspec{}}% \label{command:pgfspectra}\addcontentsline{toc}{subsection}{\texorpdfstring{\txtspec{}}{\textbackslash pgfspectra}}% \index{COMMANDS@\textbf{COMMANDS}!\textbackslash pgfspectra}% \\ [4pt]This command is used without options to draw the visible continuous spectrum: \\ \sectioncom{\txtspec}{\pgfspectra}{.05\linewidth-.3333em} \\ When using options, a continuous or discrete spectra in the visible region can be drawn, for ins\-tance: \\ [4pt]\sectioncom{\txtspecopt[width=.5\textbackslash textwidth,height=1.25cm]}{\pgfspectra[width=.5\textwidth,height=1.25cm]}{.25\linewidth-.3333em} \\ \sectioncom{\txtspecopt[width=\textbackslash textwidth,element=Ne]}{\pgfspectra[width=\textwidth,element=Ne]}{0pt} \\ [4pt]The options available for \txtspec{} are described in section \hyperlink{OPTIONS}{The options for \txtspec}. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \\ [-32pt]\ % \subsection*{}{\normalfont\large\bfseries\raisebox{1.25pt}{$\mathbf{\blacktriangleright}$}\ Utilization of \textcolor{blue!50!black}{\textbackslash wlcolor\{}\textcolor{red!50!black}{wavelength}\textcolor{blue!50!black}{\}}}% \label{command:wlcolor}\addcontentsline{toc}{subsection}{\texorpdfstring{\textcolor{blue!50!black}{\textbackslash wlcolor\{}\textcolor{red!50!black}{wavelength}\textcolor{blue!50!black}{\}}}{\textbackslash wlcolor}}% \index{COMMANDS@\textbf{COMMANDS}!\textbackslash wlcolor}% \\ [4pt]A command to convert a wavelength from 380 to 780 nanometres (or other value in the range $10\,nm\leq\lambda\leq4000\,nm$) to the respective color available as `wlcolor': \\ [10pt]\tikz{\node[fill=black!20,draw=black!20,rounded corners=1pt,right,text width=\textwidth-.6666em] at (0,0) {\vbox to 46pt{% \begin{verbatim}\tikz{\foreach \x in {380,400,...,780}{\wlcolor{\x} \draw[fill=wlcolor] (.03*\x,0) rectangle ++(.6,.5) node[midway,font=\tiny\bfseries,text=black!50] {\x};}}\end{verbatim}}};} \\ [2pt]\makebox[\linewidth][c]{\tikz{\foreach \x in {380,400,...,780}{ \wlcolor{\x} \draw[fill=wlcolor] (.03*\x,0) rectangle ++(.6,.5) node[midway,font=\tiny\bfseries,text=black!50] {\x}; } }} \\ [-6pt]\tikz{\draw[fill=black!20,draw=black!20,rounded corners=1pt] (0,0) rectangle ++(\textwidth,-3pt);} \\ [10pt]\tikz{\node[fill=black!20,draw=black!20,rounded corners=1pt,right,text width=\textwidth-.6666em] at (0,0) {\vbox to 46pt{% \begin{verbatim}\tikz{\foreach \x/\y in {10/0,100/1,500/2,1000/3,2000/4,3000/5,4000/6}{\wlcolor{\x} \draw[fill=wlcolor] (\y,0) rectangle ++(1,.5) node[midway,font=\tiny\bfseries,text=black!50] {\x};}}\end{verbatim}\vfil}};} \\ [2pt]\makebox[\linewidth][c]{\tikz{\foreach \x/\y in {10/0,100/1,500/2,1000/3,2000/4,3000/5,4000/6}{ \wlcolor{\x} \draw[fill=wlcolor] (\y,0) rectangle ++(1,.5) node[midway,font=\tiny\bfseries,text=black!50] {\x}; } }} \\ [-6pt]\tikz{\draw[fill=black!20,draw=black!20,rounded corners=1pt] (0,0) rectangle ++(\textwidth,-3pt);} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \vfill%\\ [-32pt]\ \subsection*{}{\normalfont\large\bfseries\raisebox{1.25pt}{$\mathbf{\blacktriangleright}$}\ Utilization of \txtspecstyle[options]}% \label{command:pgfspectraStyle}\addcontentsline{toc}{subsection}{\texorpdfstring{\txtspecstyle[options]}{\textbackslash pgfspectraStyle}}% \index{COMMANDS@\textbf{COMMANDS}!\textbackslash pgfspectraStyle}% \\ [4pt]Use this command to set the global style of all the subsequent drawn spectra: \\ \sectioncom{\txtspecopt[element=Ne]\hfill\color{white}(before defining the global style)}% {\pgfspectra[element=Ne]}{.05\linewidth-.3333em}% \\ \sectioncom{\txtspecstyle[width=.75\textbackslash textwidth,axis,begin=100,end=1000,axis step=50]% \\ [-5pt]\tikz[overlay]{\fill[white,rounded corners=0pt] (-.3333em,0) rectangle (\linewidth+.3333em,-3pt);}% \\ [3pt]\txtspecopt[element=Ne]\hfill\color{white}(after defining the global style)}% {\pgfspectraStyle[width=.75\textwidth,axis,begin=100,end=1000,axis step=50]\pgfspectra[element=Ne]}{.125\linewidth-.9999em}% \\ \sectioncom{\txtspecopt[element=Ne,\textcolor{red}{back=visible40,gamma=.6}]\hfill\color{white}(adding other options)}% {\pgfspectra[element=Ne,back=visible40,gamma=.6]}{.125\linewidth-.9999em}% \\ Note you can locally override the settings defined in the global style: \\ \sectioncom{\txtspecopt[element=Ne,\textcolor{red}{axis step=100}]\hfill\color{white}(overriding a global option)}% {\pgfspectra[element=Ne,axis step=100]}{.125\linewidth-.9999em} \vfill% \subsection*{}{\normalfont\large\bfseries\raisebox{1.25pt}{$\mathbf{\blacktriangleright}$}\ Utilization of \txtspecstylereset{}}% \label{command:pgfspectraStyleReset}\addcontentsline{toc}{subsection}{\texorpdfstring{\txtspecstylereset}{\textbackslash pgfspectraStyleReset}}% \index{COMMANDS@\textbf{COMMANDS}!\textbackslash pgfspectraStyleReset}% \\ [4pt]Used to reset all the options of the spectra to their default values: \\ \sectioncom{\txtspecstylereset% \\ [-5pt]\tikz[overlay]{\fill[white,rounded corners=0pt] (-.3333em,0) rectangle (\linewidth+.3333em,-3pt);}% \\ [3pt]\txtspecopt[element=Ne]}% {\pgfspectraStyleReset\pgfspectra[element=Ne]}{.05\linewidth-.3333em} \vspace{-32pt}\ % \subsection*{}{\normalfont\large\bfseries\raisebox{1.25pt}{$\mathbf{\blacktriangleright}$}\ Utilization of \txtshade{}}% \addcontentsline{toc}{subsection}{\texorpdfstring{\txtshade{}}{\textbackslash pgfspectrashade}}% \index{COMMANDS@\textbf{COMMANDS}!\textbackslash pgfspectrashade}% \label{command:shade}% \\ [4pt]This commands builds and makes available a \textcolor{red!50!black}{\bfseries h}orizontal or a \textcolor{red!50!black}{\bfseries v}ertical shading, between the `\textcolor{red!50!black}{start}' and `\textcolor{red!50!black}{end}' wavelengths (in nanometres), to use in \txttikz{} pictures with the provided `\textcolor{red!50!black}{name}'. \\ [2pt]\textit{Note that, in this command, the `start' wavelength needs to be smaller then the `end' wavelength} and is in the visible region: $\lambda_{\textsf{start}}<\lambda_{\textsf{end}}$ and $380\leq\lambda\leq780$. \\ [2pt]The optional parameter takes the value \textcolor{red!50!black}{\bfseries h} or \textcolor{red!50!black}{\bfseries v} and has the default value of \textcolor{red!50!black}{\bfseries h}. \\ [6pt]\sectioncom{\txtshadecom(380,780){myShadeA}% \\ \txtshadecom(500,700){myShadeB}% \\ \txtshadecomoption[v](380,780){myShadeC}% \\ [-5pt]\tikz[overlay]{\fill[white,rounded corners=0pt] (-.3333em,0) rectangle (\linewidth+.3333em,-3pt);}% \\ \txtshadetikz{shading=myShadeA}{0,0}{10,.5}% \\ \texttt{\txtnewline[3pt]}\txtshadetikz{shading=myShadeB}{0,0}{10,.5}% \\ \texttt{\txtnewline[3pt]}\txtshadetikz{shading=myShadeC}{0,0}{10,.5}% \\ \texttt{\txtnewline[3pt]}\txtshadetikz{shading=myShadeA,shading angle=180}{0,0}{10,.5}% }% {\\ [-10pt]\pgfspectrashade(380,780){myShadeA}\makebox[\linewidth][c]{\tikz{\fill[shading=myShadeA] (0,0) rectangle (10,.5);}}% \\ [3pt]\pgfspectrashade(500,700){myShadeB}\makebox[\linewidth][c]{\tikz{\fill[shading=myShadeB] (0,0) rectangle (10,.5);}}% \\ [3pt]\pgfspectrashade[v](380,780){myShadeC}\makebox[\linewidth][c]{\tikz{\fill[shading=myShadeC] (0,0) rectangle (10,.5);}}% \\ [3pt]\pgfspectrashade[v](380,780){myShadeC}\makebox[\linewidth][c]{\tikz{\fill[shading=myShadeA,shading angle=180] (0,0) rectangle (10,.5);}}% }{.05\linewidth-.3333em}% \vspace{-20pt}\ % \def\tmpSection{\bs{usepgfspectralibrary}\lb\red{name(s)}\rb}% \subsection*{}{\normalfont\large\bfseries\raisebox{1.25pt}{$\mathbf{\blacktriangleright}$}\ Utilization of \tmpSection{}}% \addcontentsline{toc}{subsection}{\texorpdfstring{\tmpSection{}}{\textbackslash usepgfspectralibrary}}% \index{COMMANDS@\textbf{COMMANDS}!\textbackslash usepgfspectralibrary}% \label{command:library}% \\ [4pt]Use this command to load pgf-spectra libraries anywhere in the document. The \red{name(s)} is a single library \red{name} or a comma separated list of library \red{names}. \\ As of now, available libraries are \red{data}, \red{pgfplots}, \red{tempercolor} and \red{rainbow}. \\ [6pt]\makebox[\textwidth][c]{\tikz{\node[fill=black!20,draw=black!20,rounded corners=1pt,right,text width=\textwidth-.6666em] at (0,0) {% \gray{\% Loading data library}% \\ \bs{usepgfspectralibrary}\lb\red{data}\rb% \\ \gray{\% Loading data and tempercolor libraries}% \\ \bs{usepgfspectralibrary}\lb\red{data,tempercolor}\rb% };}}% \newpage %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{\texorpdfstring{The options for \txtspec}{The options for \textbackslash pgfspectra}} \colorlet{myblue}{blue!50!black}% \def\addtoind{!\textbackslash pgfspectra@\textbf{\textcolor{myblue}{\textbackslash pgfspectra}}}% \hypertarget{OPTIONS}{For the commands} \txtspec{} and \txtspecsty{} there are a set of options available to draw the spectrum as described below. \\ [6pt]\tikz{\node[text width=\linewidth-6mm,draw=green!70,rounded corners=2pt,fill=black!10!green!10,inner sep=3mm,text centered] {\color{green!40!black}The list of options is of the form `\textcolor{red!50!black}{key}' or `\textcolor{red!50!black}{key=value}' separated by commas.};} \vfill% \label{option_usevisibleshading}% \newminoroption{use visible shading}{true}{The visible region of the spectra is drawn using a \txttikz{} shading instead of line by line, resulting in a faster drawing of that region. When set to `false' the visible region is drawn line by line: this value could be useful for printers that tend to be problematic when printing the shadings.\\ \ } \com{\txtspec\\ \txtnewline\txtspecopt[use visible shading=false]}{\vbox{\hbox to \linewidth{\hfil\pgfspectra\hfil}\vskip1pt\hbox to \linewidth{\hfil\pgfspectra[use visible shading=false]\hfil}}} \endoption% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \label{option_width}% \\ \option{width}{0.9\textbackslash textwidth}{Sets the width of the spectrum.} \com{\txtspecopt[width=10cm]}{\pgfspectra[width=10cm]} \endoption% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \label{option_height}% \\ \option{height}{1cm}{Sets the height of the spectrum.} \com{\txtspecopt[height=40pt]}{\pgfspectra[height=40pt]} \endoption% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \label{option_element}% \\ \option{element}{NONE}{A single chemical symbol of an element or a list of chemical symbols.} \com{\txtspecopt[element=H]}{\pgfspectra[element=H]} \com{\txtspecopt[element=\{H,He\}]}{\pgfspectra[element={H,He}]} \endoption% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \newpage\vspace{-32pt}\ % \label{option_charge}% \option{charge}{0}{The charge of the \textit{particle} to draw the spectrum. Use `all' to get all available lines for the element, i.e, for the atom and all the positive ions that exist in the database. For LSE data: a value between 0 and 4; all other values are processed as `all'. For NIST data: 0 or 1. All other values are processed as `all'.} \com{\txtspecopt[element=He]}{\pgfspectra[element=He]} \com{\txtspecopt[element=He,charge=1]}{\pgfspectra[element=He,charge=1]} \com{\txtspecopt[element=He,charge=2]}{\pgfspectra[element=He,charge=2]} \com{\txtspecopt[element=He,charge=all]}{\pgfspectra[element=He,charge=all]} \endoption% \vfill% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \label{option_Imin}% \option{Imin}{0}{The minimum intensity of the lines to put in the spectrum. Value from 0 to 1.} \com{\txtspecopt[element=He,Imin=.5]}{\pgfspectra[element=He,Imin=.5]} \com{\txtspecopt[element=He,Imin=.05]}{\pgfspectra[element=He,Imin=.05]} \endoption% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \label{option_relativeintensity}% \\ \option{relative intensity}{false}{Draws the lines respecting the intensity of the observed spectrum.} \com{\txtspecopt[element=He,relative intensity]}{\pgfspectra[element=He,relative intensity]} \endoption% % relative intensity threshold -> Sets the minimum intensity for the lines... Itresh+(1-Itresh)*Iline/Imax %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \vfill% \label{option_relativeintensitytreshold}% \option{relative intensity threshold}{0.25}{Sets the minimum intensity for the lines in the spectrum when using relative intensities. When set to 0.25 a line with real intensity $0$ will have a spectral intensity of $0.25$ and a line with intensity equal to the max intensity observed in that spectrum will have an intensity in the computed spectrum of $1$, assuming of course, an overall intensity in the range between 0 and 1.} \newpage% \com{\txtspecopt[element=He,relative intensity,relative intensity threshold=0]}{\pgfspectra[element=He,relative intensity,relative intensity threshold=0]} \com{\txtspecopt[element=He,relative intensity,relative intensity threshold=.25]}{\pgfspectra[element=He,relative intensity,relative intensity threshold=.25]} \com{\txtspecopt[element=He,relative intensity,relative intensity threshold=.5]}{\pgfspectra[element=He,relative intensity,relative intensity threshold=.5]} \com{\txtspecopt[element=He,relative intensity,relative intensity threshold=.75]}{\pgfspectra[element=He,relative intensity,relative intensity threshold=.75]} \com{\txtspecopt[element=He,relative intensity,relative intensity threshold=1]}{\pgfspectra[element=He,relative intensity,relative intensity threshold=1]} In fact, setting the relative intensity threshold to $1$ is equivalent to the spectrum without relative intensities: \\ \com{\txtspecopt[element=He]}{\pgfspectra[element=He]}% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \vfill% \label{option_lineintensity}% \option{line intensity}{100}{Draws all the lines with the specified intensity between 0 and 100 (as a percentage of the maximum intensity).} \com{\txtspecopt[element=He,line intensity=0]}{\pgfspectra[element=He,line intensity=0]} \com{\txtspecopt[element=He,line intensity=50]}{\pgfspectra[element=He,line intensity=50]} \com{\txtspecopt[element=He,line intensity=100]}{\pgfspectra[element=He,line intensity=100]} \com{\txtspecopt[element=He]}{\pgfspectra[element=He]}% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \newpage\vspace{-32pt}\ % \label{option_gamma}% \option{gamma}{0.8}{Gamma color correction: any positive value.} \com{\txtspecopt[gamma=.1]}{\pgfspectra[gamma=.1]} \com{\txtspecopt[gamma=.8]}{\pgfspectra[gamma=.8]} \com{\txtspecopt[gamma=1]}{\pgfspectra[gamma=1]} \com{\txtspecopt[gamma=2]}{\pgfspectra[gamma=2]} \com{\txtspecopt[gamma=5]}{\pgfspectra[gamma=5]} \com{\txtspecopt[gamma=10]}{\pgfspectra[gamma=10]}% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \vfill% \label{option_brightness}% \option{brightness}{1}{Brightness color correction as in the CMYK color model. Value between 0 and 1. Zero stands for black and one for the maximum bright. \textit{This option only works for the continuous component of the spectra, to change the ``brightness'' of spectral lines use the option `line intensity'}.} \com{\txtspecopt[brightness=.1]}{\pgfspectra[brightness=.1]} \com{\txtspecopt[brightness=.5]}{\pgfspectra[brightness=.5]} \com{\txtspecopt[brightness=1]}{\pgfspectra[brightness=1]}% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \vfill% \label{option_back}% \option{back}{black}{Sets the background color of the spectrum. Only useful when there are spectral lines. Some shorthand are defined to put the visible region in the background: `visible5', \mbox{`visible10'}, `visible15', \ldots\ , `visible100'.\\ [4pt]Note: this labels combined with the `brightness' option makes it possible to achieve other values on the background, since the visible amount (5\%,10\%,\ldots) is multiplied by the value of brightness.} \com{\txtspecopt[element=He,back=white]}{\pgfspectra[element=He,back=white]} \com{\txtspecopt[element=He,back=black!50]}{\pgfspectra[element=He,back=black!50]} \com{\txtspecopt[element=He,back=visible50]}{\pgfspectra[element=He,back=visible50]} \com{\txtspecopt[element=He,back=visible50,brightness=.26]}{\pgfspectra[element=He,back=visible50,brightness=.26]}% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \label{backIRUV}% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \vfill% \label{option_backIRUV}% \newoption{backIRUV}{black}{Sets the background color, \textit{only for the emission spectrum}, outside the visible region \\ ($10nm\leq\lambda<380nm$ and $780nm<\lambda\leq4000nm$)} \com{\txtspecopt[element=He,back=visible50,begin=100,end=1000,backIRUV=white]}% {\pgfspectra[element=He,back=visible50,begin=100,end=1000,backIRUV=white]}% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \vfill% \label{option_IRcolor}% \newoption{IRcolor}{rgb(0.3157,0.2373,0.2373)}{Sets the color for emission lines and for background in absorption spectrum in the IR region ($780nm<\lambda\leq4000nm$)} \com{\txtspecopt[element=He,back=visible50,begin=100,end=1000,IRcolor=white]}% {\pgfspectra[element=He,back=visible50,begin=100,end=1000,IRcolor=white]} \com{\txtspecopt[element=He,begin=100,end=1000,IRcolor=white,absorption]}% {\pgfspectra[element=He,begin=100,end=1000,IRcolor=white,absorption]}% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \newpage\vspace{-32pt}\ % \label{option_UVcolor}% \newoption{UVcolor}{rgb(0.3,0.2568,0.3)}{Sets the color for emission lines and for background in absorption spectrum in the UV region ($10nm\leq\lambda<380nm$)} \com{\txtspecopt[element=He,back=visible50,begin=100,end=1000,UVcolor=white]}% {\pgfspectra[element=He,back=visible50,begin=100,end=1000,UVcolor=white]} \com{\txtspecopt[element=He,begin=100,end=1000,UVcolor=white,absorption]}% {\pgfspectra[element=He,begin=100,end=1000,UVcolor=white,absorption]}% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \vfill% \label{option_lines}% \option{lines}{\{\}}{A comma separated list of wavelengths and/or a range of wavelengths -- \red{start to end} -- in the interval $[10;4000]\,nm$\\ \hfill\textit{\footnotesize\textcolor{blue}{(Interval updated in v\inversion{2.2.0}; Syntax updated in v\inversion{3.0.0})}}} \com{\txtspecopt[lines=\{400,500,550,700\}]}{\pgfspectra[lines={400,500,550,700}]} \\ \com{\txtspecopt[lines=\{200,205,400,500,550,700,850,950,980\},begin=100,end=1000]}% {\pgfspectra[lines={200,205,400,500,550,700,850,950,980},begin=100,end=1000]} \\ \com{\txtspecopt[lines=\{380 to 500\}]}% {\pgfspectra[lines={380 to 500}]} \\ \com{\txtspecopt[lines=\{420 to 500, 550, 600 to 630, 700, 720\}]}% {\pgfspectra[lines={420 to 500, 550, 600 to 630,700,720}]} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \vfill% \label{option_linewidth}% \option{line width}{1pt}{The width of each individual line in the spectrum.} \com{\txtspecopt[line width=2pt]}{\pgfspectra[line width=2pt]} \\ \com{\txtspecopt[line width=2pt,element=He]}{\pgfspectra[line width=2pt,element=He]} \label{option_begin}% \\ \option{begin}{380}{The starting wavelength in nanometres of the spectrum ($10\leq\lambda\leq4000$).\\ \hfill\textit{\footnotesize\textcolor{blue}{(Interval updated in v\inversion{2.2.0})}}} \com{\txtspecopt[begin=500]}{\pgfspectra[begin=500]}% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \vfill% \label{option_end}% \option{end}{740}{The finishing wavelength in nanometres of the spectrum ($10\leq\lambda\leq4000$).\\ \hfill\textit{\footnotesize\textcolor{blue}{(Interval updated in v\inversion{2.2.0})}}} \com{\txtspecopt[end=500]}{\pgfspectra[end=500]} \\ [3pt]\textbf{Remark:} \textit{it's obviously possible to set `begin' and `end' at the same time and if desired change the order of the wavelengths.} \\ [3pt]\com{\txtspecopt[begin=500,end=700]}{\pgfspectra[begin=500,end=700]} \com{\txtspecopt[begin=700,end=500]}{\pgfspectra[begin=700,end=500]} \com{\txtspecopt[begin=780,end=380]}{\pgfspectra[begin=780,end=380]} \com{\txtspecopt[begin=780,end=380,element=He]}{\pgfspectra[begin=780,end=380,element=He]}% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \vfill% \label{option_absorption}% \option{absorption}{false}{Draws the absorption spectrum instead of the emission one.} \com{\txtspecopt[element=H,absorption]}{\pgfspectra[element=H,absorption]} \com{\txtspecopt[element=\{H,He\},absorption]}{\pgfspectra[element={H,He},absorption]}% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \vfill% \label{option_axis}% \option{axis}{false}{By default draws a nanometric axis below the spectrum.\\ In v\inversion{2.1.0}\ is now possible to \textit{change the unit} of the axis.} \com{\txtspecopt[axis]}{\pgfspectra[axis]}% %\\ [3pt]\com{\txtspecopt[axis,begin=100,end=1500]}{\pgfspectra[axis,begin=100,end=1500]}% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %\newpage% %\vskip-13.75ex\ % \vfill% \option{axis step}{20}{The increment (in nanometres) to use in the axis scale.} \com{\txtspecopt[axis,axis step=50]}{\pgfspectra[axis,axis step=50]}% \\ [3pt]\com{\txtspecopt[axis,axis step=50,begin=100,end=1500]}{\pgfspectra[axis,axis step=50,begin=100,end=1500]}% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \label{option_axis ticks}% \vfill% \label{option_axisticks}% \newoption{axis ticks}{0}{The number of minor ticks between two consecutive ticks in the axis.} \com{\txtspecopt[axis,axis ticks=4]}{\pgfspectra[axis,axis ticks=4]} \\ [2pt]\textit{Keep in mind}, if you desire to divide two consecutive ticks into 10 equal parts set `axis ticks=9': \\ [3pt]\com{\txtspecopt[axis,axis ticks=9]}{\pgfspectra[axis,axis ticks=9]}% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \label{option_axis unit}% \vfill% \label{option_axisunit}% \newminoroption{axis unit}{nm}{Sets the unit to use in the displayed values of wavelenghts in the axis below the spectrum. Available units are: \begin{itemize} \item nanometre (nm): \textcolor{red!50!black}{axis unit=nm} \item micrometre ($\mathsf{\mu}$m): \textcolor{red!50!black}{axis unit=micron} \item angstrom ({\AA}): \textcolor{red!50!black}{axis unit=A} \end{itemize}} \newpage% \com{\txtspecopt[element=H,begin=200,end=1000,axis,axis step=50,axis ticks=4,back=visible40]\\ \txtnewline% \txtspecopt[element=H,begin=200,end=1000,axis,axis step=50,axis ticks=4,axis unit=micron,back=visible40]\\ \txtnewline% \txtspecopt[element=H,begin=200,end=1000,axis,axis step=50,axis ticks=4,axis unit=A,back=visible40]\\ \txtnewline% \txtspecopt[element=Hg,begin=1000,end=200,axis,axis step=50,axis ticks=4,back=visible40]\\ \txtnewline% \txtspecopt[element=Hg,begin=2000,end=200,axis,axis step=100,axis ticks=4,axis unit=A,back=visible40]\\ \txtnewline% \txtspecopt[element=Hg,begin=4000,end=250,axis,axis step=250,axis ticks=4,axis unit=A,back=visible40]\\ \txtnewline% \txtspecopt[element=Hg,begin=4000,end=250,axis,axis step=250,axis ticks=4,axis unit=micron,back=visible40]% }% {\vbox{\hbox{\pgfspectra[element=H,begin=200,end=1000,axis,axis step=50,axis ticks=4,back=visible40]}% \vskip1pt\hbox{\pgfspectra[element=H,begin=200,end=1000,axis,axis step=50,axis ticks=4,axis unit=micron,back=visible40]}% \vskip1pt\hbox{\pgfspectra[element=H,begin=200,end=1000,axis,axis step=50,axis ticks=4,axis unit=A,back=visible40]}% \vskip1pt\hbox{\pgfspectra[element=Hg,begin=1000,end=200,axis,axis step=50,axis ticks=4,back=visible40]}% \vskip1pt\hbox{\pgfspectra[element=Hg,begin=2000,end=200,axis,axis step=100,axis ticks=4,axis unit=A,back=visible40]}% \vskip1pt\hbox{\pgfspectra[element=Hg,begin=4000,end=250,axis,axis step=250,axis ticks=4,axis unit=A,back=visible40]}% \vskip1pt\hbox{\pgfspectra[element=Hg,begin=4000,end=250,axis,axis step=250,axis ticks=4,axis unit=micron,back=visible40]}% }}% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \label{option_axis unit precision}% %\newpage% \vfill% \newminoroption{axis unit precision}{3}{Sets the precision of the displayed wavelenghts in the axis below the spectrum.} \com{\txtspecopt[element=H,begin=200,end=1000,axis,axis step=50,axis ticks=4,axis unit=micron,back=visible40]\\ \txtnewline% \txtspecopt[element=H,begin=200,end=1000,axis,axis step=50,axis ticks=4,axis unit=micron,axis unit precision=2,back=visible40]% }{\vbox{% \hbox{\pgfspectra[element=H,begin=200,end=1000,axis,axis step=50,axis ticks=4,axis unit=micron,back=visible40]}% \vskip1pt\hbox{\pgfspectra[element=H,begin=200,end=1000,axis,axis step=50,axis ticks=4,axis unit=micron,axis unit precision=2,back=visible40]}% }}% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \newpage%\vfill%\vskip-9.75ex\ \label{option_axis_label}% \vskip-9.75ex\ \option{axis label}{false}{Shows or hides (default) the axis label below it. When this key is set to \red{true}, the \red{axis} key is also set to \red{true}.\hfill\textit{\textcolor{blue}{(new in v3.0.0)}}} \com{\txtspecopt[axis label=true]}{\pgfspectra[axis label=true]}% \vfill% \label{option_axis_label_text}% \option{axis label text}{\{\}}{If not empty, shows the axis label with the given text below it. In this case, the \red{axis label} key is set to \red{true}.\hfill\textit{\textcolor{blue}{(new in v3.0.0)}}} \com{\txtspecopt[axis label text=\{Wavelength in nanometers\}]}{\pgfspectra[axis label text={Wavelength in nanometers}]}% \vfill% \label{option_axis_label_position}% \option{axis label position}{center}{Sets the position of the axis label to \red{left} or \red{center} or \red{right}.\hfill\textit{\textcolor{blue}{(new in v3.0.0)}}} \com{\txtspecopt[axis label=true,axis label position=right]}{\pgfspectra[axis label=true,axis label position=right]}% \\ [3pt]\com{\txtspecopt[axis label text=\{Wavelength in nanometers\},axis label position=left]}{\pgfspectra[axis label text={Wavelength in nanometers},axis label position=left]}% \\ [3pt]\com{\txtspecopt[axis label text=\{\textbackslash hbox to .925\textbackslash linewidth\{\textbackslash{} Wavelength in\\ nanometers\textbackslash hfill\$\textbackslash lambda\textbackslash,(nm)\$\}\},axis label position=left]}{\pgfspectra[axis label text={\hbox to .925\linewidth{\ Wavelength in nanometers\hfill$\lambda\,(nm)$}},axis label position=left]}% \vfill% \label{option_axiscolor}% \option{axis color}{black}{The color of the axis.} \com{\txtspecopt[axis,axis color=red!50!green!50!blue!50]}{\pgfspectra[axis,axis color=red!50!green!50!blue!50]}% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \newpage% \label{option_axisfont}% \vskip-9.75ex\ \option{axis font}{\textbackslash tiny}{The font specs to use in the axis.} \com{\txtspecopt[axis,axis font=\textbackslash fontsize\{3\}\{3\}\textbackslash itshape\textbackslash selectfont]}{\pgfspectra[axis,axis font=\fontsize{3}{3}\itshape\selectfont]}% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \\ % \label{option_axisfontcolor}% \option{axis font color}{white}{The color of the font used in the axis.} \com{\txtspecopt[axis,axis font color=blue!50!white]}{\pgfspectra[axis,axis font color=blue!50!white]}% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \\ %\newpage\vskip-9.75ex\ % \label{option_label}% \option{label}{false}{Puts a label for the spectrum.} \com{\txtspecopt[label]}{\pgfspectra[label]} \com{\txtspecopt[label,element=He]}{\pgfspectra[label,element=He]}% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \label{option_labelpostion}% \\ \option{label position}{west}{Sets the position of the label according to:} \tikz{\path[left color=orange!20,right color=black!30!orange!50,rounded corners=2pt,] (0,0) rectangle ++(\textwidth,2); \node[dotted,fill=black!20,opacity=.4] (x) at (.5\textwidth,1) {\vbox to 1cm{\hsize=8cm\vfill\hfil\small\itshape spectrum\hfil\vfill}}; \tikzset{inner sep=0.1pt} \node[left] at (x.west) {west}; \node[above left] at (x.north west) {north west}; \node[above] at (x.north) {north}; \node[above right] at (x.north east) {north east}; \node[right] at (x.east) {east}; \node[below right] at (x.south east) {south east}; \node[below] at (x.south) {south}; \node[below left] at (x.south west) {south west};} \com{\txtspecopt[label,label position=east,element=He]}{\pgfspectra[label,label position=east,element=He]}% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \label{option_labelfont}% \\ \option{label font}{\textbackslash bfseries\textbackslash small}{The font specs for the label.} \com{\txtspecopt[label,label font=\textbackslash footnotesize\textbackslash itshape,element=He]}{\pgfspectra[label,label font=\footnotesize\itshape,element=He]} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \newpage\vskip-9.75ex\ % \label{option_labelfontcolor}% \option{label font color}{black}{The color of the font used in the label.} \com{\txtspecopt[label,label font color=blue!50!white,element=He]}{\pgfspectra[label,label font color=blue!50!white,element=He]}% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \label{option_labelbeforetext}% \\ \option{label before text}{\{\}}{Inserts text before the value stored in the label: if chemical symbols were provided, the label has them stored, otherwise it is empty.} \com{\txtspecopt[label,label before text=text\textbackslash\ ,element=He]}{\pgfspectra[label,label before text=text\ ,element=He]} \\ [3pt]\textbf{Remark:} \textit{The \textbackslash}\verb*| | \textit{is to insert a space between the text entered by user and the text stored in label.}% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \label{option_labelaftertext}% \\ [-10pt]\option{label after text}{\{\}}{Inserts text after the value stored in the label: if chemical symbols were provided, the label has them stored, otherwise it is empty.} \com{\txtspecopt[label,label after text=\textbackslash\ text,element=He]}{\pgfspectra[label,label after text=\ text,element=He]} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \label{redshift}% \\ %\vfill% \label{option_redshift}% \newoption{redshift}{\{\}}{Redshift (or blueshift) the spectral lines:\\ The redshift value ($z$) is \textit{defined} as $1+z=\lambda_{obs}/\lambda_{E}$ which leaves the observed wavelength to $\lambda_{obs}=(1+z)\lambda_{E}$, given the emitted wavelength of the source ($\lambda_{E}$). \begin{itemize} \item\textbf{Use `redshift='} to directly enter the redshift value \item or \textbf{use `redshift=\{D=/\}'} to compute the Relativistic Doppler redshift with $\overline{v}=\textsf{}$ and $\theta=\textsf{}^o$. \\[3pt] The Relativistic Doppler redshift ($1+z$) is calculated accordingly: $$1+z=\frac{1+\overline{v}\cos\theta}{\sqrt{1-\overline{v}^2}}\quad\quad\overline{v}=\frac{v}{c}$$ \\ where $\overline{v}$ is the \textit{normalized velocity} (in units of the speed of light in vacuum, $c$) of the emitter and $\theta$ is the angle between the direction of relative motion and the direction of emission in the observer's frame (zero angle is directly away from the observer). \\ So, if the source of light is moving away from an observer, then redshift occurs ($z>0$), but, if the source moves towards the observer, then blueshift occurs ($z<0$). \ \\ [3pt]\makebox[\linewidth][c]{\includegraphics[width=.8\linewidth]{figsManual/redshift.pdf}} \end{itemize}}% % redshift \\ [3pt]\com{\txtspecopt[element=He,back=visible40,gamma=.6,axis,axis step=50,axis ticks=4,begin=100,end=1000,redshift=\{D=.001/0\}]} {\pgfspectra[element=He,back=visible40,gamma=.6,axis,axis step=50,axis ticks=4,begin=100,end=1000,redshift={D=.001/0}]}\\ \com{\txtspecopt[element=He,back=visible40,gamma=.6,axis,axis step=50,axis ticks=4,begin=100,end=1000,redshift=\{D=.001/180\}]} {\pgfspectra[element=He,back=visible40,gamma=.6,axis,axis step=50,axis ticks=4,begin=100,end=1000,redshift={D=.001/180}]} %\newpage \com{\txtspecopt[element=He,back=visible40,gamma=.6,axis,axis step=50,axis ticks=4,begin=100,end=1000,redshift=.5]} {\pgfspectra[element=He,back=visible40,gamma=.6,axis,axis step=50,axis ticks=4,begin=100,end=1000,redshift=.5]}\\ \com{\txtspecopt[element=He,absorption,gamma=.6,axis,axis step=50,axis ticks=4,begin=100,end=1000,redshift=-.5]} {\pgfspectra[element=He,absorption,gamma=.6,axis,axis step=50,axis ticks=4,begin=100,end=1000,redshift=-.5]}%\\ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % show redshift value \label{option_showredshiftvalue}% \\ \newoption{show redshift value}{false}{% Writes the value of the redshift (left below the spectrum).} \com{\txtspecopt[element=He,back=visible40,gamma=.6,axis,axis step=50,axis ticks=4,begin=100,end=1000,redshift=\{D=.001/0\},show redshift value]} {\pgfspectra[element=He,back=visible40,gamma=.6,axis,axis step=50,axis ticks=4,begin=100,end=1000,redshift={D=.001/0},show redshift value]}\\ \com{\txtspecopt[element=He,back=visible40,gamma=.6,axis,axis step=50,axis ticks=4,begin=100,end=1000,redshift=.5,show redshift value]} {\pgfspectra[element=He,back=visible40,gamma=.6,axis,axis step=50,axis ticks=4,begin=100,end=1000,redshift=.5,show redshift value]} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \newpage\ \vfill% \label{libraries}% \section{Libraries} In this part the \hypertarget{sec:lib}{library} packages are documented. They provide additional commands to extend the capabilities provided by this package out of the box. The libraries are not loaded by default since many users will not need them. \\ [10pt]The available libraries are: \begin{itemize} \item\textbf{data} library: \begin{itemize}\item[--]provides the commands to display and/or export to a file the spectral lines of selected elements.\end{itemize} \item\textbf{pgfplots} library: \begin{itemize}\item[--]provides the commands to create a plot shade or a plot map to use with \mbox{\txtPGFPLOTS}.\end{itemize} \item\textbf{tempercolor} library: \begin{itemize}\item[--]provides the command to converts a temperature (in Kelvin) into its correlated color.\end{itemize} \item\textbf{rainbow} library: \begin{itemize}\item[--]provides the command to draw a rainbow.\end{itemize} \end{itemize} \vfill\vfill% \newpage% \subsection*{}{\normalfont\large\bfseries\raisebox{1.25pt}{$\mathbf{\blacktriangleright}$}\ data Library}% \label{library:data}\addcontentsline{toc}{subsection}{\texorpdfstring{\cyan{\textbf{data}}}{data}}% \index{LIBRARIES@\textbf{\cyan{LIBRARIES}}!data@\textbf{\red{data}}}% \\ [10pt]\pgfspectralib{data}{% This library implements a command that allows the user to extract the spectral lines data used by \txtspec. After that using one of the other two commands provided it is possible do display the data in a table or export it to a file. \\ The commands are: \begin{itemize} \item\bs{pgfspectradata}\lp\red{name of data set}\rp\lb\red{keys}\rb% \item\bs{pgfspectratable}\lp\red{table options}\rp\lb\red{name(s) of data set(s)}\rb% \item\bs{pgfspectrawrite}\lp\red{filename}\rp\lb\red{name(s) of data set(s)}\rb% \end{itemize} }%pgfspectralib \vspace{-10pt}% \def\tmpName{\bs{pgfspectradata}}% \def\tmpCom{\bs{pgfspectradata}\lp\red{name of data set}\rp\lb\red{keys}\rb}% \subsubsection*{}{\pgfspectralibsubsubsection{Utilization of \tmpCom}}% \addcontentsline{toc}{subsubsection}{\texorpdfstring{\tmpCom{}}{\textbackslash pgfspectradata}}% \label{command:pgfspectradata}% \index{LIBRARIES@\textbf{\cyan{LIBRARIES}}!data@\textbf{\red{data}}!\blue{\textbackslash pgfspectradata}}% \\ [10pt]This command loads spectral lines data of the element or elements specified with the \mbox{\red{element}} key. Note that this key is exactly the same as the one used in \txtspec. \\ This command also shares the \red{charge}, \red{Imin}, \red{redshift}, \red{begin} and \red{end} keys with \mbox{\txtspec}, but has its own \red{precision} and \red{unit} keys. \\ \bs{pgfspectradata} does not produce any \textit{visible} output, but it does the \textit{work} needed by \bs{pgfspectratable} and \bs{pgfspectrawrite} commands. The optional \red{name of data set} argument makes that \textit{name} available for use with \mbox{\bs{pgfspectratable}} or \bs{pgfspectrawrite}. \\ [4pt]See \hyperlink{commandpgfspectratable}{utilization of \bs{pgfspectratable}} and \hyperlink{commandpgfspectrawrite}{utilization of \bs{pgfspectrawrite}} for examples of the application of this command. \vspace{-10pt}% \subsubsection*{}{\pgfspectralibsubsubsection{The options for \tmpName}}% \addcontentsline{toc}{subsubsection}{\texorpdfstring{The options for \tmpName}{The options for \textbackslash pgfspectradata}}% \label{command:pgfspectradata:options}% \index{LIBRARIES@\textbf{\cyan{LIBRARIES}}!data@\textbf{\red{data}}!\blue{The options for \textbackslash pgfspectradata}}% \def\addtoind{!\textbackslash pgfspectradata@\textbf{\textcolor{myblue}{\textbackslash pgfspectradata}}}% \label{option_name_of_data_set}% \liboption{name of data set}{\{\}}{A name formed of valid letters.\hfill\pgfspectraMnewinversion{3.0.0}} \pgfspectradata[dataH]{element=H}% \sectioncom{% \bs{pgfspectradata}\lp\red{dataH}\rp\lb\red{element=H}\rb% }{% This command does not generate any visible output, but internally stores the following data:\\ [-3pt] \makebox[\linewidth][c]{\dataH}% }{0pt}% \label{option_precision}% \liboption{precision}{1}{Sets the precision of the data internally stored.\hfill\pgfspectraMnewinversion{3.0.0}} \pgfspectradata{element=H,precision=2}% \sectioncom{% \bs{pgfspectradata}\lb\red{element=H,precision=2}\rb% }{% This command does not generate any visible output, but internally stores the following data:\\ \makebox[\linewidth][c]{\manualData}% }{0pt}% \label{option_unit}% \liboption{unit}{\{\}}{If empty, the \red{axis unit} key value of \txtspec{} is used, otherwise the \red{unit} key value is used. This key, like \red{axis unit} key, can have the values \red{nm} for nanometers, \red{micron} for micrometers or \red{A} for angstroms.\hfill\pgfspectraMnewinversion{3.0.0}} \pgfspectradata{element=H,unit=A}% \sectioncom{% \bs{pgfspectradata}\lb\red{element=H,unit=A}\rb% }{% This command does not generate any visible output, but internally stores the following data:\\ \makebox[\linewidth][c]{\manualData}% }{0pt}% \pgfspectraStyle[axis unit=micron,begin=100]% \pgfspectradata{element=H}% \\ \sectioncom{% \bs{pgfspectraStyle}\lp\red{axis unit=micron,begin=100}\rp% \\ \bs{pgfspectradata}\lb\red{element=H}\rb% }{% This command does not generate any visible output, but internally stores the following data:\\ \makebox[\linewidth][c]{\manualData}% }{0pt}% \pgfspectraStyleReset% \\ \tikz{\node[fill=black!20,draw=black!20,rounded corners=1pt,right,text width=\textwidth-.6666em] at (0,0) {\bs{pgfspectraStyleReset}};} \def\tmpName{\bs{pgfspectratable}}% \def\tmpCom{\bs{pgfspectratable}\lp\red{table options}\rp\lb\red{name(s) of data set(s)}\rb}% \subsubsection*{}{\pgfspectralibsubsubsection{Utilization of \tmpCom}}% \addcontentsline{toc}{subsubsection}{\texorpdfstring{\tmpCom{}}{\textbackslash pgfspectratable}}% \label{command:pgfspectratable}% \index{LIBRARIES@\textbf{\cyan{LIBRARIES}}!data@\textbf{\red{data}}!\blue{\textbackslash pgfspectratable}}% \\ [10pt]\hypertarget{commandpgfspectratable}{This command} displays the loaded data in a table. Both arguments are optional. \\ [4pt]When used without arguments, the last \textit{unnamed} data loaded is used: \\ \sectioncom{% \bs{pgfspectradata}\lb\red{element=Ne}\rb\gray{\% loads the spectral lines of neon}% \\ \textbackslash\textbackslash\ \bs{pgfspectratable}\gray{\% displays the table...}% }{% \pgfspectradata{element=Ne}% \pgfspectratable% }{0pt}% \\ [10pt]The \red{table options} keys are \red{title}, \red{back color}, \red{data back color}, \red{text color}, \red{width} and \mbox{\red{elements column width}}. \\ [10pt]The optional \red{name(s) of data set(s)} argument is either a single name or a comma separated list of names previously defined via \bs{pgfspectradata}. \subsubsection*{}{\pgfspectralibsubsubsection{The options for \tmpName}}% \addcontentsline{toc}{subsubsection}{\texorpdfstring{The options for \tmpName}{The options for \textbackslash pgfspectratable}}% \label{command:pgfspectratable:options}% \index{LIBRARIES@\textbf{\cyan{LIBRARIES}}!data@\textbf{\red{data}}!\blue{The options for \textbackslash pgfspectratable}}% \def\addtoind{!\textbackslash pgfspectratable@\textbf{\textcolor{myblue}{\textbackslash pgfspectratable}}}% \label{option_title}% \liboptionmultiline{title}{SPECTRAL LINES OF ELEMENT(S)\\ {\small<\textbackslash\textbackslash\ redshift value>}\\ \textbackslash\textbackslash\ wavelength in \red{unit}}% {Sets the title in the table header.\hfill\pgfspectraMnewinversion{3.0.0}} \newpage% \pgfspectradata{element=H}% \sectioncom{% \bs{pgfspectradata}\lb\red{element=H}\rb% \\ \textbackslash\textbackslash\ \bs{pgfspectratable}% }{% \pgfspectratable }{0pt}% \pgfspectradata{element={H,He}}% \\ \sectioncom{% \bs{pgfspectradata}\lb\red{element=\{H,He\}}\rb% \\ \textbackslash\textbackslash\ \bs{pgfspectratable}% }{% \pgfspectratable }{0pt}% \pgfspectradata[Hrs]{element=H,redshift={D=0.01/180}}% \\ \sectioncom{% \bs{pgfspectradata}\lp\red{Hrs}\rp\lb\red{element=H,redshift=\{D=0.01/180\}}\rb% \\ \textbackslash\textbackslash\ \bs{pgfspectratable}\lb\red{Hrs}\rb% }{% \pgfspectratable{Hrs} }{0pt}% \pgfspectradata{element=H,relative intensity}% \\ \sectioncom{% \bs{pgfspectradata}\lb\red{element=H,relative intensity}\rb% \\ \textbackslash\textbackslash\ \bs{pgfspectratable}% }{% \pgfspectratable }{0pt}% \pgfspectradata[dataOI]{element={O}}% \pgfspectradata[dataOII]{element={O},charge=1}% \pgfspectradata[dataOIII]{element={O},charge=2}% \pgfspectradata[dataOIV]{element={O},charge=3}% \\ \sectioncom{% \gray{\% this example requires the LSE data loaded}% \\ \gray{\% use \textbackslash usepackage[LSE]\{pgf-spectra\} in the document preamble}% \\ \bs{pgfspectradata}\lp\red{dataOI}\rp\lb\red{element=O}\rb% \\ \textbackslash\textbackslash\ \bs{pgfspectradata}\lp\red{dataOII}\rp\lb\red{element=O,charge=1}\rb% \\ \textbackslash\textbackslash\ \bs{pgfspectradata}\lp\red{dataOIII}\rp\lb\red{element=O,charge=2}\rb% \\ \textbackslash\textbackslash\ \bs{pgfspectradata}\lp\red{dataOIV}\rp\lb\red{element=O,charge=3}\rb% \\ \textbackslash\textbackslash\ \bs{pgfspectratable}\lp\red{title=\{Oxygen spectral lines in the visible region% \textbackslash\textbackslash\ Wavelength in nanometers\textbackslash\textbackslash\ \$\textbackslash lambda\textbackslash,(nm)\$\}}\rp\lb\red{dataOI}\rb% \\ \textbackslash\textbackslash\ \bs{pgfspectratable}\lp\red{title=\{Spectral lines of oxygen and its ions in the visible region% \textbackslash\textbackslash\ Wavelength in nanometers\}}\rp\lb\red{dataOI,dataOII,dataOIII,dataOIV}\rb% }{% \pgfspectratable[title={Oxygen spectral lines in the visible region\\ Wavelength in nanometers\\ $\lambda\,(nm)$}]{dataOI} \\ \pgfspectratable[title={Spectral lines of oxygen and its ions in the visible region\\ Wavelength in nanometers}]{dataOI,dataOII,dataOIII,dataOIV} }{0pt}% \label{option_back_color}% \liboption{back color}{black!10}% {Sets the background color of the table header, of the \textit{element(s)} column, of the table border lines and of the lines between rows.\hfill\pgfspectraMnewinversion{3.0.0}} \sectioncom{% \bs{pgfspectratable}\lp\red{back color=blue!10}\rp% }{% \pgfspectratable[back color=blue!10] }{0pt}% \label{option_data_back_color}% \liboption{data back color}{white}% {Sets the background color of each data row.\hfill\pgfspectraMnewinversion{3.0.0}} \sectioncom{% \bs{pgfspectratable}\lp\red{data back color=black!5}\rp% }{% \pgfspectratable[data back color=black!5] }{0pt}% \label{option_text_color}% \liboption{text color}{black}{Sets the color of all text in the table.\hfill\pgfspectraMnewinversion{3.0.0}} \sectioncom{% \bs{pgfspectratable}\lp\red{text color=blue!50!black}\rp% }{% \pgfspectratable[text color=blue!50!black] }{0pt}% \label{option_width_(table)}% \liboption{width}{\textbackslash linewidth}{Sets the total width of the table.\hfill\pgfspectraMnewinversion{3.0.0}} \sectioncom{% \lblue{\textbackslash begin}\lb\green{center}\rb \bs{pgfspectratable}\lp\red{width=.75\textbackslash linewidth}\rp% \lblue{\textbackslash end}\lb\green{center}\rb }{% \makebox[\linewidth][c]{\pgfspectratable[width=.75\linewidth]} }{0pt}% \label{option_elements_column_width}% \liboption{elements column width}{2.5em}{Sets the width of the \textit{element(s)} column.\hfill\pgfspectraMnewinversion{3.0.0}} \sectioncom{% \bs{pgfspectratable}\lp\red{elements column width=.1\textbackslash linewidth}\rp% }{% \pgfspectratable[elements column width=.1\linewidth] }{0pt}% \def\tmpName{\bs{pgfspectrawrite}}% \def\tmpCom{\bs{pgfspectrawrite}\lp\red{filename}\rp\lb\red{name(s) of data set(s)}\rb}% \subsubsection*{}{\pgfspectralibsubsubsection{Utilization of \tmpCom}}% \addcontentsline{toc}{subsubsection}{\texorpdfstring{\tmpCom{}}{\textbackslash pgfspectrawrite}}% \label{command:pgfspectrawrite}% \index{LIBRARIES@\textbf{\cyan{LIBRARIES}}!data@\textbf{\red{data}}!\blue{\textbackslash pgfspectrawrite}}% \\ [10pt]\hypertarget{commandpgfspectrawrite}{This command} \textbf{writes the provided data set(s)} to a file making the data available for use at any time, and in any context. \\ [4pt]Both arguments are optional: \begin{itemize} \item[--]if no \red{filename} is given, the name \orange{\textsf{spectradata.tex}} is used, otherwise the \textit{filename} is formed by any character recognized by the operating system (this means, for instance, that \textsf{\_} character can be used), followed by an optional extension -- \textsf{tex}, \textsf{csv}, \textsf{txt} or \textsf{dat}. If the extension is not present, the \textsf{tex} extension is appended to the given name. \item[--]if no \red{name(s) of data set(s)} is given, the last \textit{unnamed} data loaded will be used. \end{itemize} For example, using just \bs{pgfspectrawrite} writes, in the current working directory, the file \mbox{\textsf{spectradata.tex}} with the following contents, which were the last \textit{unnamed} data loaded: \pgfspectrawrite% \\ [3pt]\pgfspectraMloadfile spectradata.tex\relax \\ [6pt]\bs{pgfspectrawrite}\lp\red{myfile.csv}\rp\ writes, in the current working directory, the file \mbox{\textsf{myfile.csv}} with the following contents, which were the last \textit{unnamed} data loaded: \pgfspectrawrite[myfile.csv]% \\ [3pt]\pgfspectraMloadfile myfile.csv\relax \newpage% \bs{pgfspectrawrite}\lp\red{oxygen.dat}\rp\lb\red{dataOI,dataOII,dataOIII,dataOIV}\rb\ writes, in the current working directory, the file \mbox{\textsf{oxygen.dat}} with the following contents: \pgfspectrawrite[oxygen.dat]{dataOI,dataOII,dataOIII,dataOIV}% \\ [3pt]\pgfspectraMloadfile oxygen.dat\relax \\ [6pt]\bs{pgfspectrawrite}\lp\red{Hredshift.txt}\rp\lb\red{Hrs}\rb\ writes, in the current working directory, the file \mbox{\textsf{Hredshift.txt}} with the following contents: \pgfspectrawrite[Hredshift.txt]{Hrs}% \\ [3pt]\pgfspectraMloadfile[RS]Hredshift.txt\relax \newpage% \subsection*{}{\normalfont\large\bfseries\raisebox{1.25pt}{$\mathbf{\blacktriangleright}$}\ pgfplots Library}% \label{library:pgfplots}\addcontentsline{toc}{subsection}{\texorpdfstring{\cyan{\textbf{pgfplots}}}{pgfplots}}% \index{LIBRARIES@\textbf{\cyan{LIBRARIES}}!pgfplots@\textbf{\red{pgfplots}}}% \\ [10pt]\pgfspectralib{pgfplots}{% This library implements two commands that define the necessary \textit{material} needed to be used with the \txtPGFPLOTS{} package, referring to the colors provided by \txtspec. \\ The commands are: \begin{itemize} \item\bs{pgfspectraplotmap}\lp\red{}\rp\lb\red{name}\rb% \item\bs{pgfspectraplotshade}\lp\red{options}\rp\lb\red{name}\rb% \end{itemize} The commands -- \txtshadename, \txtplotshadename{} and \mbox{\txtplotmapname} -- were inspired in the \textcolor{purple}{TeX - LaTeX Stack Exchange} questions, \href{https://tex.stackexchange.com/q/576755/95441}{Filling optical spectrum curve with color gradient} and \href{https://tex.stackexchange.com/q/348491/95441}{How to create a electromagnetic spectrum using pgfplots package (together with colormaps)}, which were referred by Stefan Pinnow, as examples, in a features request for the \pack{} package. }%pgfspectralib \vspace{-10pt}% \subsubsection*{}{\pgfspectralibsubsubsection{Utilization of \txtplotmap}}% \addcontentsline{toc}{subsubsection}{\texorpdfstring{\txtplotmap{}}{\textbackslash pgfspectraplotmap}}% \label{command:colormap}% \index{LIBRARIES@\textbf{\cyan{LIBRARIES}}!pgfplots@\textbf{\red{pgfplots}}!\blue{\textbackslash pgfspectraplotmap}}% \\ [10pt]This command builds and makes available a \textcolor{red!50!black}{\bfseries l}ow or \textcolor{red!50!black}{\bfseries h}igh \textit{resolution} color map in the wavelength range from $380\,nm$ to $780\,nm$ to use in \txtPGFPLOTS{} with the provided `\textcolor{red!50!black}{name}': \\ [6pt]\setbox0=\vbox{\begin{verbatim} \begin{tikzpicture} \begin{axis}[colormap name=myColorMap] \addplot+[scatter,only marks,domain=0:8,samples=200] {exp(x)}; \end{axis} \end{tikzpicture} \begin{tikzpicture} \begin{axis}[colormap name=myColorMap] \addplot+[scatter,only marks,domain=0:4*pi,samples=200] {sin(deg(x))}; \end{axis} \end{tikzpicture} \end{verbatim}}% \sectioncom{\txtplotmapcom{myColorMap}{\small\% low resolution (default value for optional parameter)}% \\ [-5pt]\tikz[overlay]{\fill[white,rounded corners=0pt] (-.3333em,0) rectangle (\linewidth+.3333em,-3pt);}% \\ \usebox0% }{% \ \\ [-10pt]\makebox[\linewidth][c]{\includegraphics[height=3.75cm]{figsManual/PGFPLOTS5.pdf}\includegraphics[height=3.75cm]{figsManual/PGFPLOTS6.pdf}}}{.05\linewidth-.3333em}% \setbox0=\vbox{\begin{verbatim} \begin{tikzpicture} \begin{axis}[colormap name=myColorMapH] \addplot+[scatter,only marks,domain=0:8,samples=200] {exp(x)}; \end{axis} \end{tikzpicture} \begin{tikzpicture} \begin{axis}[colormap name=myColorMapH] \addplot+[scatter,only marks,domain=0:4*pi,samples=200] {sin(deg(x))}; \end{axis} \end{tikzpicture} \end{verbatim}}% \\ \sectioncom{\txtplotmapcomoption[h]{myColorMapH}{\small\% high resolution (`h' value in optional parameter)}% \\ [-5pt]\tikz[overlay]{\fill[white,rounded corners=0pt] (-.3333em,0) rectangle (\linewidth+.3333em,-3pt);}% \\ \usebox0% }{% \ \\ [-10pt]\makebox[\linewidth][c]{\includegraphics[height=3.75cm]{figsManual/PGFPLOTS7.pdf}\includegraphics[height=3.75cm]{figsManual/PGFPLOTS8.pdf}}}{.05\linewidth-.3333em}% \\ Actually using high or low resolution produces the same effect on plot. The difference resides on the number of colors available to the `color of colormap' feature. For more information see \hyperlink{example:pgfspectraplots}{Using \txtplotshadename{} and \txtplotmapname{} with \txtPGFPLOTS{}}. %\vspace{-32pt}\ % \subsubsection*{}{\pgfspectralibsubsubsection{Utilization of \txtplotshade}}% \addcontentsline{toc}{subsubsection}{\texorpdfstring{\txtplotshade{}}{\textbackslash pgfspectraplotshade}}% \label{command:plotshade}% \index{LIBRARIES@\textbf{\cyan{LIBRARIES}}!pgfplots@\textbf{\red{pgfplots}}!\blue{\textbackslash pgfspectraplotshade}}% \\ [10pt]This command, without any options, builds and makes available a shading in the wavelength range from $\mathsf{380\,nm}$ to $\mathsf{780\,nm}$ to use in \txtPGFPLOTS{} with the provided `\textcolor{red!50!black}{name}'. \\ [6pt]\sectioncom{% \txtplotshadecom{myPlotShadeA}% \\ [-5pt]\tikz[overlay]{\fill[white,rounded corners=0pt] (-.3333em,0) rectangle (\linewidth+.3333em,-3pt);}% \\ \texttt{\textbackslash fbox\{}\txtshadetikz{shading=myPlotShadeA}{0,0}{7.5,.75}\texttt{\}}% }{% \pgfspectraplotshade{myPlotShadeA}% \fbox{\tikz{\fill[shading=myPlotShadeA] (0,0) rectangle (7.5,.75);}}\vspace{3pt}% }{.05\linewidth-.3333em}% \\ [4pt]The optional argument can receive specific options for the shade or \txtspec{} options: \\ [6pt]\sectioncom{% \txtplotshadecomoption[shade begin=0,shade end=4000,IRcolor=white,UVcolor=white,\\ shade opacity=.2,gamma=.6]{myPlotShadeB}% \\ [-5pt]\tikz[overlay]{\fill[white,rounded corners=0pt] (-.3333em,0) rectangle (\linewidth+.3333em,-3pt);}% \\ \texttt{\textbackslash fbox\{}\txtshadetikz{shading=myPlotShadeB}{0,0}{7.5,.75}\texttt{\}}% }{% \pgfspectraplotshade[shade begin=0,shade end=4000,IRcolor=white,UVcolor=white,shade opacity=.2,gamma=.6]{myPlotShadeB}% \fbox{\tikz{\fill[shading=myPlotShadeB] (0,0) rectangle (7.5,.75);}}\vspace{3pt}% }{.05\linewidth-.3333em}% \\ [4pt]The specific options available are \textcolor{red!50!black}{shade end}, \textcolor{red!50!black}{shade opacity} and \textcolor{red!50!black}{shade opacity color}. See \hyperlink{OPTIONSplotshade}{The options for \txtplotshadename} for detailed information on using these options. When used in \txtPGFPLOTS{} it's possible to do plots like: \\ [2pt]\makebox[\linewidth][c]{\hfil\includegraphics[height=4.5cm]{figsmanual/plotshadecom1.pdf}\hfil\includegraphics[height=4.5cm]{figsmanual/plotshadecom2.pdf}\hfil}% \\ [2pt]For these plots and other ones see \hyperlink{example:pgfspectraplots}{Using \txtplotshadename{} and \txtplotmapname{} with \txtPGFPLOTS{}}. %\newpage% %\vfill\vfill%\\ [16pt] \subsubsection*{}{\pgfspectralibsubsubsection{The options for \txtplotshadename}}% \addcontentsline{toc}{subsubsection}{\texorpdfstring{The options for \txtplotshadename}{The options for \textbackslash pgfspectraplotshade}}% \label{command:plotshade:options}% \index{LIBRARIES@\textbf{\cyan{LIBRARIES}}!pgfplots@\textbf{\red{pgfplots}}!\blue{The options for \textbackslash pgfspectraplotshade}}% \def\addtoind{!\textbackslash pgfspectraplotshade@\textbf{\textcolor{myblue}{\textbackslash pgfspectraplotshade}}}% \\ [10pt]\hypertarget{OPTIONSplotshade}{The command} \txtplotshadename{} creates a shade to use with the \texttt{\large\textbackslash addplot} command provided by the \txtPGFPLOTS{} package. The shade starts at \textsf{\large\textcolor{red!50!black}{shade begin}} and finishes at \textsf{\large\textcolor{red!50!black}{shade end}}. The shading could be adjusted using the following options: \\ [8pt]\tikz{\node[text width={\textwidth-6pt},inner xsep=3pt,draw=green!50,fill=green!10,below right,rounded corners=3pt] at (0,0) {% \\ \makebox[12pt][s]{}\textbullet\ shade begin%default=380,% minimum value 0 \\ \makebox[12pt][s]{}\textbullet\ shade end%default=780,% maximum value 16000 \\ \makebox[12pt][s]{}\textbullet\ shade opacity%default=1,% \\ \makebox[12pt][s]{}\textbullet\ shade opacity color%default=white% \\ \makebox[12pt][s]{}\textbullet\ logarithmic%default=false% };}% \label{option_shadebegin}% \libnewminorrevoption{shade begin}{380}{This value determines the start wavelength of the computed shading. It should be set equal to the minimum value of the plotted data. It could be different from the inferior limit of the domain provided to the plot (see the \href{http://mirrors.ctan.org/graphics/pgf/contrib/pgfplots/doc/pgfplots.pdf\#page=55}{\txtPGFPLOTS{} package documentation} for more information). The range of accepted values goes from $\mathsf{0\,nm}$ to (\textcolor{red!50!black}{shade end}-1).}% \label{option_shadeend}% \libnewminoroption{shade end}{780}{This value determines the end wavelength of the computed shading. It should be set equal to the maximum value of the plotted data and could be different from the superior limit of the domain provided to the plot. The range of accepted values goes from (\textcolor{red!50!black}{shade begin}+1) to $\mathsf{16\hspace{.1pt}000\,nm}$.\\ \ }% \\ \com[3pt]{% \txtplotshadecom{shadeDefault} \\ [-5pt]\tikz[overlay]{\fill[white,rounded corners=0pt] (-.3333em,0) rectangle (\linewidth+.3333em,-3pt);}% \\ \texttt{\textbackslash fbox\{}\txtshadetikz{shading=shadeDefault}{0,0}{7.5,.75}\texttt{\}}% }{% \pgfspectraplotshade{shadeDefault}% \fbox{\tikz{\fill[shading=shadeDefault] (0,0) rectangle (7.5,.75);}}% }% \\ \com[3pt]{% \txtplotshadecomoption[shade begin=600]{shadeBegin600} \\ [-5pt]\tikz[overlay]{\fill[white,rounded corners=0pt] (-.3333em,0) rectangle (\linewidth+.3333em,-3pt);}% \\ \texttt{\textbackslash fbox\{}\txtshadetikz{shading=shadeBegin600}{0,0}{7.5,.75}\texttt{\}}% }{% \pgfspectraplotshade[shade begin=600]{shadeBegin600}% \fbox{\tikz{\fill[shading=shadeBegin600] (0,0) rectangle (7.5,.75);}}% }% \\ \com[3pt]{% \txtplotshadecomoption[shade end=600]{shadeEnd600} \\ [-5pt]\tikz[overlay]{\fill[white,rounded corners=0pt] (-.3333em,0) rectangle (\linewidth+.3333em,-3pt);}% \\ \texttt{\textbackslash fbox\{}\txtshadetikz{shading=shadeEnd600}{0,0}{7.5,.75}\texttt{\}}% }{% \pgfspectraplotshade[shade end=600]{shadeEnd600}% \fbox{\tikz{\fill[shading=shadeEnd600] (0,0) rectangle (7.5,.75);}}% }% \\ \com[3pt]{% \txtplotshadecomoption[shade begin=300,shade end=600]{shade300to600}% \\ [-5pt]\tikz[overlay]{\fill[white,rounded corners=0pt] (-.3333em,0) rectangle (\linewidth+.3333em,-3pt);}% \\ \texttt{\textbackslash fbox\{}\txtshadetikz{shading=shade300to600}{0,0}{7.5,.75}\texttt{\}}% }{% \pgfspectraplotshade[shade begin=300,shade end=600]{shade300to600}% \fbox{\tikz{\fill[shading=shade300to600] (0,0) rectangle (7.5,.75);}}% }% \\ \com[3pt]{% \txtplotshadecomoption[shade begin=600,shade end=900]{shade600to900}% \\ [-5pt]\tikz[overlay]{\fill[white,rounded corners=0pt] (-.3333em,0) rectangle (\linewidth+.3333em,-3pt);}% \\ \texttt{\textbackslash fbox\{}\txtshadetikz{shading=shade600to900}{0,0}{7.5,.75}\texttt{\}}% }{% \pgfspectraplotshade[shade begin=600,shade end=900]{shade600to900}% \fbox{\tikz{\fill[shading=shade600to900] (0,0) rectangle (7.5,.75);}}% }% \\ \com[3pt]{% \txtplotshadecomoption[shade begin=300,shade end=900]{shade300to900}% \\ [-5pt]\tikz[overlay]{\fill[white,rounded corners=0pt] (-.3333em,0) rectangle (\linewidth+.3333em,-3pt);}% \\ \texttt{\textbackslash fbox\{}\txtshadetikz{shading=shade300to900}{0,0}{7.5,.75}\texttt{\}}% }{% \pgfspectraplotshade[shade begin=300,shade end=900]{shade300to900}% \fbox{\tikz{\fill[shading=shade300to900] (0,0) rectangle (7.5,.75);}}% }% \endoption% %\vfill% \label{option_shadeopacity}% \libnewminoroption{shade opacity}{1}{The opacity of the computed shade. `0' stands for $\mathsf{0\%}$ and the shading is totaly transparent; `1' stands for $\mathsf{100\%}$ and the shading isn't transparent at all.}% \\ \com[3pt]{% \txtplotshadecom{shadeDefault} \\ [-5pt]\tikz[overlay]{\fill[white,rounded corners=0pt] (-.3333em,0) rectangle (\linewidth+.3333em,-3pt);}% \\ \texttt{\textbackslash fbox\{}\txtshadetikz{shading=shadeDefault}{0,0}{7.5,.75}\texttt{\}}% }{% \pgfspectraplotshade{shadeDefault}% \fbox{\tikz{\fill[shading=shadeDefault] (0,0) rectangle (7.5,.75);}}% }% \\ \com[3pt]{% \txtplotshadecomoption[shade opacity=.5]{shadeOpacity50} \\ [-5pt]\tikz[overlay]{\fill[white,rounded corners=0pt] (-.3333em,0) rectangle (\linewidth+.3333em,-3pt);}% \\ \texttt{\textbackslash fbox\{}\txtshadetikz{shading=shadeOpacity50}{0,0}{7.5,.75}\texttt{\}}% }{% \pgfspectraplotshade[shade opacity=.5]{shadeOpacity50}% \fbox{\tikz{\fill[shading=shadeOpacity50] (0,0) rectangle (7.5,.75);}}% }% \\ \com[3pt]{% \txtplotshadecomoption[shade opacity=0]{shadeOpacity0} \\ [-5pt]\tikz[overlay]{\fill[white,rounded corners=0pt] (-.3333em,0) rectangle (\linewidth+.3333em,-3pt);}% \\ \texttt{\textbackslash fbox\{}\txtshadetikz{shading=shadeOpacity0}{0,0}{7.5,.75}\texttt{\}}% }{% \pgfspectraplotshade[shade opacity=0]{shadeOpacity0}% \fbox{\tikz{\fill[shading=shadeOpacity0] (0,0) rectangle (7.5,.75);}}% }% \endoption% %\vfill% \label{option_shadeopacitycolor}% \libnewminoroption{shade opacity color}{white}{The background color of the computed shading. Only visible when \textcolor{red!50!black}{shade opacity} is lesser then 1.}% \\ \com[3pt]{% \txtplotshadecom{shadeDefault} \\ [-5pt]\tikz[overlay]{\fill[white,rounded corners=0pt] (-.3333em,0) rectangle (\linewidth+.3333em,-3pt);}% \\ \texttt{\textbackslash fbox\{}\txtshadetikz{shading=shadeDefault}{0,0}{7.5,.75}\texttt{\}}% }{% \pgfspectraplotshade{shadeDefault}% \fbox{\tikz{\fill[shading=shadeDefault] (0,0) rectangle (7.5,.75);}}% }% \\ \com[3pt]{% \txtplotshadecomoption[shade opacity color=black]{shadeOpacityBlack} \\ [-5pt]\tikz[overlay]{\fill[white,rounded corners=0pt] (-.3333em,0) rectangle (\linewidth+.3333em,-3pt);}% \\ \texttt{\textbackslash fbox\{}\txtshadetikz{shading=shadeOpacityBlack}{0,0}{7.5,.75}\texttt{\}}% }{% \pgfspectraplotshade[shade opacity color=black]{shadeOpacityBlack}% \fbox{\tikz{\fill[shading=shadeOpacityBlack] (0,0) rectangle (7.5,.75);}}% }% \\ \com[3pt]{% \txtplotshadecomoption[shade opacity color=black, shade \mbox{opacity=.5}]{shadeOpacityBlack50} \\ [-5pt]\tikz[overlay]{\fill[white,rounded corners=0pt] (-.3333em,0) rectangle (\linewidth+.3333em,-3pt);}% \\ \texttt{\textbackslash fbox\{}\txtshadetikz{shading=shadeOpacityBlack50}{0,0}{7.5,.75}\texttt{\}}% }{% \pgfspectraplotshade[shade opacity color=black,shade opacity=.5]{shadeOpacityBlack50}% \fbox{\tikz{\fill[shading=shadeOpacityBlack50] (0,0) rectangle (7.5,.75);}}% }% \endoption% %\newpage\ \vspace{-32pt}% \label{option_shadelogarithmic}% \libnewminorrevoption{logarithmic}{false}{When set to true the shading is build in a logarithmic scale. The smaller wavelengths are \textit{wided} and the longer ones are \textit{shortened} in the displayed region.}% \\ \com[3pt]{% \txtplotshadecomoption[logarithmic]{logshadeDefault}% \\ [-5pt]\tikz[overlay]{\fill[white,rounded corners=0pt] (-.3333em,0) rectangle (\linewidth+.3333em,-3pt);}% \\ \texttt{\textbackslash fbox\{}\txtshadetikz{shading=shadeDefault}{0,0}{7.5,.75}\texttt{\}}% \\ \txtnewline\texttt{\textbackslash fbox\{}\txtshadetikz{shading=logshadeDefault}{0,0}{7.5,.75}\texttt{\}}% }{% \pgfspectraplotshade[logarithmic]{logshadeDefault}% \vbox{\hsize=\linewidth\hfil\fbox{\tikz{\fill[shading=shadeDefault] (0,0) rectangle (7.5,.75);}}% \vskip0pt\hfil\fbox{\tikz{\fill[shading=logshadeDefault] (0,0) rectangle (7.5,.75);}}}% }% \\ \com[3pt]{% \txtplotshadecomoption[logarithmic,shade begin=300,shade end=600]{logshade300to600}% \\ [-5pt]\tikz[overlay]{\fill[white,rounded corners=0pt] (-.3333em,0) rectangle (\linewidth+.3333em,-3pt);}% \\ \texttt{\textbackslash fbox\{}\txtshadetikz{shading=shade300to600}{0,0}{7.5,.75}\texttt{\}}% \\ \txtnewline\texttt{\textbackslash fbox\{}\txtshadetikz{shading=logshade300to600}{0,0}{7.5,.75}\texttt{\}}% }{% \pgfspectraplotshade[logarithmic,shade begin=300,shade end=600]{logshade300to600}% \vbox{\hsize=\linewidth\hfil\fbox{\tikz{\fill[shading=shade300to600] (0,0) rectangle (7.5,.75);}}% \vskip0pt\hfil\fbox{\tikz{\fill[shading=logshade300to600] (0,0) rectangle (7.5,.75);}}}% }% \\ \com[3pt]{% \txtplotshadecomoption[logarithmic,shade begin=600,shade end=900]{logshade600to900}% \\ [-5pt]\tikz[overlay]{\fill[white,rounded corners=0pt] (-.3333em,0) rectangle (\linewidth+.3333em,-3pt);}% \\ \texttt{\textbackslash fbox\{}\txtshadetikz{shading=shade600to900}{0,0}{7.5,.75}\texttt{\}}% \\ \txtnewline\texttt{\textbackslash fbox\{}\txtshadetikz{shading=logshade600to900}{0,0}{7.5,.75}\texttt{\}}% }{% \pgfspectraplotshade[logarithmic,shade begin=600,shade end=900]{logshade600to900}% \vbox{\hsize=\linewidth\hfil\fbox{\tikz{\fill[shading=shade600to900] (0,0) rectangle (7.5,.75);}}% \vskip0pt\hfil\fbox{\tikz{\fill[shading=logshade600to900] (0,0) rectangle (7.5,.75);}}}% }% \\ \com[3pt]{% \txtplotshadecomoption[logarithmic,shade begin=300,shade end=900]{logshade300to900}% \\ [-5pt]\tikz[overlay]{\fill[white,rounded corners=0pt] (-.3333em,0) rectangle (\linewidth+.3333em,-3pt);}% \\ \texttt{\textbackslash fbox\{}\txtshadetikz{shading=shade300to900}{0,0}{7.5,.75}\texttt{\}}% \\ \txtnewline\texttt{\textbackslash fbox\{}\txtshadetikz{shading=logshade300to900}{0,0}{7.5,.75}\texttt{\}}% }{% \pgfspectraplotshade[logarithmic,shade begin=300,shade end=900]{logshade300to900}% \vbox{\hsize=\linewidth\hfil\fbox{\tikz{\fill[shading=shade300to900] (0,0) rectangle (7.5,.75);}}% \vskip0pt\hfil\fbox{\tikz{\fill[shading=logshade300to900] (0,0) rectangle (7.5,.75);}}}% }% \\ \com[3pt]{% \txtplotshadecomoption[logarithmic,shade begin=10,shade end=10000]{logshade10to10000}% \\ [-5pt]\tikz[overlay]{\fill[white,rounded corners=0pt] (-.3333em,0) rectangle (\linewidth+.3333em,-3pt);}% \\ \texttt{\textbackslash fbox\{}\txtshadetikz{shading=shade10to10000}{0,0}{7.5,.75}\texttt{\}}% \\ \txtnewline\texttt{\textbackslash fbox\{}\txtshadetikz{shading=logshade300to900}{0,0}{7.5,.75}\texttt{\}}% }{% \pgfspectraplotshade[shade begin=10,shade end=10000]{shade10to10000}% \pgfspectraplotshade[logarithmic,shade begin=10,shade end=10000]{logshade10to10000}% \vbox{\hsize=\linewidth\hfil\fbox{\tikz{\fill[shading=shade10to10000] (0,0) rectangle (7.5,.75);}}% \vskip0pt\hfil\fbox{\tikz{\fill[shading=logshade10to10000] (0,0) rectangle (7.5,.75);}}}% }% \endoption% \newpage% \subsection*{}{\normalfont\large\bfseries\raisebox{1.25pt}{$\mathbf{\blacktriangleright}$}\ tempercolor Library}% \label{library:tempercolor}\addcontentsline{toc}{subsection}{\texorpdfstring{\cyan{\textbf{tempercolor}}}{tempercolor}}% \index{LIBRARIES@\textbf{\cyan{LIBRARIES}}!tempercolor@\textbf{\red{tempercolor}}}% \\ [10pt]\pgfspectralib{tempercolor}{This library provides the command \txttempercolor{Kelvin} that uses the CIE 1964 10-degree color matching function to convert a given temperature, in Kelvin ($\mathsf{1000\,K\leq T\leq40\hspace{.1ex}000\,K}$), to the respective correlated color. For more information on the implemented algorithm, please see: \small\begin{itemize} \item\href{https://tannerhelland.com/2012/09/18/convert-temperature-rgb-algorithm-code.html}{https://tannerhelland.com/2012/09/18/convert-temperature-rgb-algorithm-code.html} \item\href{https://www.zombieprototypes.com/?p=210}{https://www.zombieprototypes.com/?p=210} \item\href{https://github.com/neilbartlett/color-temperature}{https://github.com/neilbartlett/color-temperature} \end{itemize}\normalsize} \vspace{-10pt}% \subsubsection*{}{\pgfspectralibsubsubsection{Utilization of \txttempercolor{Kelvin}}}% \addcontentsline{toc}{subsubsection}{\texorpdfstring{\txttempercolor{Kelvin}}{\textbackslash tempercolor}}% \label{command:tempercolor}% \index{LIBRARIES@\textbf{\cyan{LIBRARIES}}!tempercolor@\textbf{\red{tempercolor}}!\blue{\textbackslash tempercolor}}% \\ [10pt]\tikz{\node[fill=black!20,draw=black!20,rounded corners=1pt,right,text width=\textwidth-.6666em] at (0,0) {\vbox to 86pt{% \begin{verbatim}\foreach \T in {1000,1700,1850,2400,2550,2700,3000,3200,% 3350,5000,5500,6000,6200,6500,6600,6700,9500,15000,% 27000,40000} {\tempercolor{\T}\tikz{ \fill[tempercolor,font=\small] (0,0) rectangle (7.5,.5) % node[midway] {\color{black}\T\ K};}\\ [-1pt]% }% \end{verbatim}\vfil}};}% \vspace{-5pt} \begin{center} \foreach \T in {1000,1700,1850,2400,2550,2700,3000,3200,3350,5000,5500,6000,6200,6500,6600,6700,9500,15000,27000,40000}{% \tempercolor{\T}\tikz{\fill[tempercolor,font=\small] (0,0) rectangle (7.5,.5) node[midway] {\color{black}\T\ K};}\\ [-1pt]}% \end{center} \vspace{-13pt}\tikz{\draw[fill=black!20,draw=black!20,rounded corners=1pt] (0,0) rectangle ++(\textwidth,-3pt);} \newpage% \subsection*{}{\normalfont\large\bfseries\raisebox{1.25pt}{$\mathbf{\blacktriangleright}$}\ rainbow Library}% \label{library:rainbow}\addcontentsline{toc}{subsection}{\texorpdfstring{\cyan{\textbf{rainbow}}}{rainbow}}% \index{LIBRARIES@\textbf{\cyan{LIBRARIES}}!rainbow@\textbf{\red{rainbow}}}% \\ [10pt]\pgfspectralib{rainbow}{This library provides the command \txtrainbowtitle{} that allows you to draw a rainbow with or without options.} \vspace{-10pt}% \subsubsection*{}{\pgfspectralibsubsubsection{Utilization of {\txtrainbow{}}}}% \addcontentsline{toc}{subsubsection}{\texorpdfstring{\txtrainbow{}}{\textbackslash pgfspectrarainbow}}% \label{command:rainbow}% \index{LIBRARIES@\textbf{\cyan{LIBRARIES}}!rainbow@\textbf{\red{rainbow}}!\blue{\textbackslash pgfspectrarainbow}}% \\ [10pt]Without options this command draws a rainbow with the specified radius: \\ \sectioncom{\txtrainbowcom{2cm}% }{% \hfil\includegraphics[scale=2]{figsManual/arcoiris1.pdf}% }{0pt}% \\ [4pt]The rainbow is designed with the following schema resulting in a clipped and shown region: \\ [2pt]\makebox[\linewidth][c]{\includegraphics[scale=1.4]{figsManual/arco_iris.pdf}}% % THE OPTIONS \\ The options available could be specific options for the rainbow or \textit{common} \txttikz{} options: % \newminoroption{option}{default}{description} \begin{itemize} \item the rainbow specific options:% a comma separated list of 'key=value' pairs as listed below. \begin{itemize} \item rainbow start%default=.6,% -> 60% \item rainbow knock out%default=.4,% -> 40% \item rainbow fade%default={},% -> applies a scope fading in clipped region \item rainbow transparency%default=0 \item rainbow background%default=blue,% \end{itemize} \item the \txttikz{} options: any option known by \txttikz{} and/or \txttikz{} libraries. \end{itemize} \subsubsection*{}{\pgfspectralibsubsubsection{The options for \txtrainbowname}% \addcontentsline{toc}{subsubsection}{\texorpdfstring{The options for \txtrainbowname}{The options for \textbackslash pgfspectrarainbow}}% \label{command:colormap}% \index{LIBRARIES@\textbf{\cyan{LIBRARIES}}!rainbow@\textbf{\red{rainbow}}!\blue{The options for \textbackslash pgfspectrarainbow}}% \def\addtoind{!\textbackslash pgfspectrarainbow@\textbf{\textcolor{myblue}{\textbackslash pgfspectrarainbow}}}% \\ [10pt]\hypertarget{OPTIONSrainbow}{For the} command \txtrainbowname{} there are a set of options that control the rainbow drawn. \\ [8pt]\tikz{\node[text width={\textwidth-6pt},inner xsep=3pt,draw=green!50,fill=green!10,below right,rounded corners=3pt] at (0,0) {% \\ The specific rainbow options are: \\ \makebox[12pt][s]{}\textbullet\ rainbow start%default=.6,% -> 60% \\ \makebox[12pt][s]{}\textbullet\ rainbow knock out%default=.4,% -> 40% \\ \makebox[12pt][s]{}\textbullet\ rainbow fade%default={},% -> applies a scope fading in clipped region \\ \makebox[12pt][s]{}\textbullet\ rainbow transparency%default=0 \\ \makebox[12pt][s]{}\textbullet\ rainbow background%default=white,% \\ Some \txttikz{} keys that affect the rainbow are: \\ \makebox[12pt][s]{}\textbullet\ `color'\\ \makebox[12pt][s]{}\textbullet\ opacity\\ \makebox[12pt][s]{}\textbullet\ scope fading };} \\ [10pt]The default rainbow drawn is: \\ [6pt]\com{% \txtrainbowcom{2cm} }{% \pgfspectrarainbow{2cm} }% %\vfill% \label{option_rainbowstart}% \libnewminoroption{rainbow start}{.6}{The fraction from which the rainbow colors begin, relative to the center of a circle with radius 1. This value should be in the interval [0,1].} \\ \com{% \txtrainbowcomoptionrainbow(rainbow start=.8){2cm}\textcolor{black!60}{\itshape\% the rainbow colors starts at 1.6cm} \\ \textbackslash hspace\{1cm\}\textcolor{black!60}{\itshape\%} \\ \txtrainbowcomoptionrainbow(rainbow start=.4){2cm}\textcolor{black!60}{\itshape\% the rainbow colors starts at .8cm} }{% \pgfspectrarainbow(rainbow start=.8){2cm}\hspace{1cm}\pgfspectrarainbow(rainbow start=.4){2cm} }% %\vfill% \label{option_rainbowknockout}% \libnewminoroption{rainbow knock out}{.4}{The relative distance from the half-circle base to perform the clip. This value should be in the interval [-1,1].} \\ \com{% \txtrainbowcomoptionrainbow(rainbow knock out=0){2cm}\textcolor{black!60}{\itshape\% the full half circle} }{% \pgfspectrarainbow(rainbow knock out=0){2cm} }% \\ \com{% \txtrainbowcomoptionrainbow(rainbow knock out=.4){2cm}\textcolor{black!60}{\itshape\% the default value} }{% \pgfspectrarainbow(rainbow knock out=.4){2cm} }% \\ \com{% \txtrainbowcomoptionrainbow(rainbow knock out=.8){2cm}\textcolor{black!60}{\itshape\% only 80\% of the half circle is shown} }{% \pgfspectrarainbow(rainbow knock out=.8){2cm} }% %\newpage \\ \com{% \txtrainbowcomoptionrainbow(rainbow knock out=-.4){2cm}\textcolor{black!60}{\itshape\% «extending» the half-circle} }{% \pgfspectrarainbow(rainbow knock out=-.4){2cm} }% %\\ %\vfill% \label{option_rainbowfade}% \libnewminoroption{rainbow fade}{\{\}}{Applies a scope fading in the clipped region (requires loading the \txttikz{} fadings library). For more information about the fadings see the \txttikz{} manual.} \\ %\vfill%\newpage%\\ \com{% \textcolor{black!60}{\itshape\%\textbackslash usetikzlibrary\{fadings\}}% \\ \textcolor{black!60}{\itshape...} \\ \txtrainbowcomoptionrainbow(rainbow fade=south){2cm} \\ \textbackslash hspace\{1cm\}\textcolor{black!60}{\itshape\%} \\ \txtrainbowcomoptionrainbow(rainbow fade=west){2cm} }{% \pgfspectrarainbow(rainbow fade=south){2cm}\hspace{1cm}\pgfspectrarainbow(rainbow fade=west){2cm} }% \label{option_raibowtransparency}% \libnewminoroption{rainbow transparency}{0}{The overall transparency of the rainbow. `0' ($\mathsf{0\%}$) stands for the fill colors in the rainbow without transparency ; `1' ($\mathsf{100\%}$) represents a totally transparent rainbow.} \\ \com{% \txtrainbowcomoptionrainbow(rainbow transparency=.5){2cm} }{% \pgfspectrarainbow(rainbow transparency=.5){2cm} }% \label{option_rainbowbackground}% \libnewminoroption{rainbow background}{white}{The background color below the rainbow (only visible with transparency).} \\ \com{% \txtrainbowcomoptionrainbow(rainbow background=blue){2cm} \\ \textbackslash hspace\{1cm\}\textcolor{black!60}{\itshape\%} \\ \txtrainbowcomoptionrainbow(rainbow background=blue,rainbow transparency=.5){2cm} }{% \pgfspectrarainbow(rainbow background=blue){2cm}\hspace{1cm}\pgfspectrarainbow(rainbow background=blue,rainbow transparency=.5){2cm} }% \\ [6pt]Some of the \txttikz{} keys that affect the rainbow: \\ [3pt]\com{% \txtrainbowcomoptiontikz[blue]{2cm}\textcolor{black!60}{\itshape\% Setting only the fill color only takes no effect} }{% \pgfspectrarainbow[blue]{2cm}% }% \\ \com{% \txtrainbowcomoptiontikz[blue,scope fading=south]{2cm} }{% \pgfspectrarainbow[blue,scope fading=south]{2cm}% }% \\ \com{% \txtrainbowcomoptiontikz[blue,opacity=.5]{2cm} }{% \pgfspectrarainbow[blue,opacity=.5]{2cm}% }% \\ [10pt]More examples in \hyperlink{example:rainbow}{Using \txtrainbowname}. \newpage% \section{Examples}\vspace{-22pt}% \subsection*{}{\normalfont\bfseries\raisebox{1.25pt}{$\mathbf{\blacktriangleright}$}\ Using \textbackslash pgfspectra} \label{example:pgfspectra}\addcontentsline{toc}{subsection}{\texorpdfstring{Using \txtspec}{Using \textbackslash pgfspectra}}% \\ [4pt]Here are some examples for drawing some \textit{eventually useful} spectra: \\ [3pt]\com{\txtspecopt% [element=He,axis,label,label position=north west,\\ label after text=\textbackslash\ emission spectrum:]}% {\pgfspectra[element=He,axis,label,label position=north west,label after text=\ emission spectrum:]} \\ [3pt]\com{\txtspecopt% [element=He,axis,label,label position=north west,label after text=\\ \textbackslash\ emission spectrum:,relative intensity,relative intensity threshold=.5]}% {\pgfspectra[element=He,axis,label,label position=north west,label after text=\ emission spectrum:,relative intensity,relative intensity threshold=.5]} \\ [3pt]\com{\txtspecopt% [element=He,charge=all,line intensity=50,Imin=.05]}% {\pgfspectra[element=He,charge=all,line intensity=50,Imin=.05]} \\ [3pt]\com{\txtspecopt% [element=He,absorption,axis,label,label position=north west,label after text=\textbackslash\ absorption spectrum:,relative intensity,relative intensity threshold=.5]}% {\pgfspectra[element=He,absorption,axis,label,label position=north west,label after text=\ absorption spectrum:,relative intensity,relative intensity threshold=.5]} \\ [3pt]\com{\txtspecopt% [element=He,charge=all,absorption,line intensity=50]}% {\pgfspectra[element=He,charge=all,absorption,line intensity=50]} \\ [3pt]\com{\txtspecopt% [element=He,charge=all,relative intensity,back=visible75,gamma=2]}% {\pgfspectra[element=He,charge=all,relative intensity,back=visible75,gamma=2]} \\ [1pt]\textit{\small When the lines are manually inserted it's possible to use `label before text' only with personalized text. In the next three examples `label before text' is used to make labels for a multiple choice problem, omitting evidently the type of luminous font.} \\ [3pt] $\checkmark$ Laser He-Ne \\ [3pt]\com{\txtspecopt% [height=.7cm,end=740,lines=\{633\},line width=1.25pt,width=.75\textbackslash linewidth,label,axis,label before text=(A),\\axis font=\textbackslash fontsize\{4pt\}\{6pt\}\textbackslash selectfont]}% {\pgfspectra[height=.7cm,begin=380,end=740,lines={633},line width=1.25pt,width=.75\linewidth,label,axis,label before text=(A),axis font=\fontsize{4pt}{6pt}\selectfont]} \newpage$\checkmark$ Fluorescent lamp \\ [3pt]\com{\txtspecopt% [height=.7cm,end=740,lines=\{380,425,450,525,550,600,625,640,705\}, line width=1.25pt,width=.75\textbackslash linewidth,label,axis,label before text=(B),\\axis font=\textbackslash fontsize\{4pt\}\{6pt\}\textbackslash selectfont]}% {\pgfspectra[height=.7cm,begin=380,end=740,lines={380,425,450,525,550,600,625,640,705},line width=1.25pt,width=.75\linewidth,label,axis,label before text=(B),axis font=\fontsize{4pt}{6pt}\selectfont]} \\ [3pt]$\checkmark$ Blue LED \\ [3pt]\com{\txtspecopt% [height=.7cm,end=740,lines=\{450 to 510\},% \\line width=1.25pt,\mbox{width=.75\textbackslash linewidth,label,axis,label before text=(C)},% \\axis font=\textbackslash fontsize\{4pt\}\{6pt\}\textbackslash selectfont]}% {\pgfspectra[height=.7cm,end=740,lines={450to510},line width=1.25pt,width=.75\linewidth,label,axis,label before text=(C),axis font=\fontsize{4pt}{6pt}\selectfont]}% \vfill%\\ [6pt] $\checkmark$ Sun like spectrum%H,He,C,Na,Mg,Fe \\ [3pt]\com{\txtspecopt% [element=\{H,Fe,Mg,Na\},absorption,line intensity=40,Imin=.05]}% {\pgfspectra[element={H,Fe,Mg,Na},absorption,line intensity=40,Imin=.05]} \vfill%\\ [6pt] $\checkmark$ Sirius like spectrum \\ [3pt]\com{\txtspecopt% [element=\{H,He\},absorption,line intensity=40,Imin=.05]}% {\pgfspectra[element={H,He},absorption,line intensity=40,Imin=.05]} \vfill%\\ [6pt] $\checkmark$ ``Classical'' emission spectra of elements: \\ [3pt]\com{\txtspecopt% [element=H,back=visible40,gamma=.6,label,axis,Imin=.05]}% {\pgfspectra[element=H,back=visible40,gamma=.6,label,axis,Imin=.05]} \\ [3pt]\com{\txtspecopt% [element=He,back=visible40,gamma=.6,label,axis,Imin=.05]}% {\pgfspectra[element=He,back=visible40,gamma=.6,label,axis,Imin=.05]} \\ [3pt]\com{\txtspecopt% [element=Ne,back=visible40,gamma=.6,label,axis,Imin=.05]}% {\pgfspectra[element=Ne,back=visible40,gamma=.6,label,axis,Imin=.05]} \newpage% $\checkmark$ Series of hydrogen: \\ [3pt]\com{\txtspecopt% [element=H,line width=.5pt,begin=50,end=1950,axis,axis step=100,axis ticks=4,back=visible40,gamma=.6,brightness=.5,label,% label\\ position=north,label font=\textbackslash footnotesize,label after text=\{ydrogen Lyman, Balmer and Paschen series (wavelengths in nm)\}]}% {\pgfspectra[element=H,line width=.5pt,begin=50,end=1950,axis,axis step=100,axis ticks=4,back=visible40,gamma=.6,brightness=.5,label,label position=north,label font=\footnotesize,label after text={ydrogen Lyman, Balmer and Paschen series (wavelengths in nm)}]} \\ [6pt]$\checkmark$ Redshifted \& Blueshifted lines of hydrogen using the \textsf{\textbackslash foreach} statement: \\ [3pt]\bigexample{% \txtspecstyle[axis,axis ticks=4,back=visible40,gamma=.6,line width=.5pt]% \\ [2pt]\txtspecopt[element=H,label,label position=north west,label font=\textbackslash footnotesize,label before text=\{spectra of\textbackslash\ \}]% \\ [2pt]\textbackslash foreach \textbackslash SQ/\textbackslash z/\textbackslash shift in \{H/0.01/redshifted,H/-0.01/blueshifted\}\{% \\ \makebox[36pt][s]{}\begin{minipage}{\linewidth-36pt}% \txtspecopt[element=\textbackslash SQ,label,label position=north west,label font=\textbackslash footnotesize,% label before text=\{\textbackslash shift\textbackslash\ spectra of\textbackslash\ \},label after text=\{\textbackslash\ (z=\textbackslash z)\},redshift=\textbackslash z]% \end{minipage}% \\ \}% \\ [2pt]\textbackslash foreach \textbackslash SQ/\textbackslash z/\textbackslash shift in \{H/\{D=0.01/0\}/redshifted,H/\{D=0.01/180\}/blueshifted\}\{% \\ \makebox[36pt][s]{}\begin{minipage}{\linewidth-36pt}% \txtspecopt[element=\textbackslash SQ,label,label position=north west,label font=\textbackslash footnotesize,% label before text=\{\textbackslash shift\textbackslash\ spectra of\textbackslash\ \},redshift=\textbackslash z,show redshift value]% \end{minipage}% \\ \}% }{% \pgfspectraStyle[axis,axis ticks=4,back=visible40,gamma=.6,line width=.5pt,width=\linewidth]% \pgfspectra[element=H,label,label position=north west,label font=\footnotesize,label before text={spectra of\ }]% \foreach \SQ/\z/\shift in {H/0.01/redshifted,H/-0.01/blueshifted}{% \\ \pgfspectra[element=\SQ,label,label position=north west,label font=\footnotesize,label before text={\shift\ spectra of\ },label after text={\ (z=\z)},redshift=\z]% }% \foreach \SQ/\z/\shift in {H/{D=0.01/0}/redshifted,H/{D=0.01/180}/blueshifted}{% \\ \pgfspectra[element=\SQ,label,label position=north west,label font=\footnotesize,label before text={\shift\ spectra of\ },redshift=\z,show redshift value]% }}% \newpage% \subsection*{}\vspace{-22pt}{\normalfont\bfseries\raisebox{1.25pt}{$\mathbf{\blacktriangleright}$}\ Using \txtshadename{} in \txttikz{}} \label{example:pgfspectratikzshade}\addcontentsline{toc}{subsection}{\texorpdfstring{Using \txtshadename{} in \txttikz{}}{Using \textbackslash pgfspectrashade in TikZ}}% \\ [4pt]Obviously, the \textit{normal} \txttikz{} keys used to control the shadings apply to the shading generated via \txtshadename{}: \\ [10pt]\tikz{\node[fill=black!20,draw=black!20,rounded corners=1pt,right,text width=\textwidth-.6666em] at (0,0) {% \txtshadecom(380,780){myShadeA}\\ \txtnewline% \txtshadetikz{shading=myShadeA,shading angle=180}{0,0}{10,.5}\\ \txtnewline% \txtshadetikz{shading=myShadeA,shading angle=90}{0,0}{10,.5}\\ \txtnewline% \txtshadetikz{shading=myShadeA,shading angle=45}{0,0}{10,.5}% };} \begin{center} \tikz{\fill[shading=myShadeA,shading angle=180] (0,0) rectangle (10,.5);} \\ \tikz{\fill[shading=myShadeA,shading angle=90] (0,0) rectangle (10,.5);} \\ \tikz{\fill[shading=myShadeA,shading angle=45] (0,0) rectangle (10,.5);} \end{center} \vspace{-6pt}\tikz{\draw[fill=black!20,draw=black!20,rounded corners=1pt] (0,0) rectangle ++(\textwidth,-3pt);} \\ [6pt]Providing an opacity to the drawing and applying a shade works well too: \\ [10pt]\tikz{\node[fill=black!20,draw=black!20,rounded corners=1pt,right,text width=\textwidth-.6666em] at (0,0) {% \txtshadecom(380,780){myShadeA} \begin{itemize} \item on black background: \\ \txtnewline\txtshadetikz{shading=myShadeA,opacity=.5}{0,0}{10,.5}% \item on white background: \\ \txtnewline\txtshadetikz{white,shading=myShadeA,opacity=.5}{0,0}{10,.5}% \item on red background: \\ \txtnewline\txtshadetikz{red,shading=myShadeA,opacity=.5}{0,0}{10,.5}% \end{itemize} };} \begin{center} \begin{itemize} \item on black background: \\ \tikz{\fill[shading=myShadeA,opacity=.5] (0,0) rectangle (10,.5);} \item on white background: \\ \tikz{\fill[white,shading=myShadeA,opacity=.5] (0,0) rectangle (10,.5);} \item on red background: \\ \tikz{\fill[red,shading=myShadeA,opacity=.5] (0,0) rectangle (10,.5);} \end{itemize} \end{center} \vspace{-6pt}\tikz{\draw[fill=black!20,draw=black!20,rounded corners=1pt] (0,0) rectangle ++(\textwidth,-3pt);} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \\ The gamma in the generated shade (via \txtshadename{}) could be modified using the `\textcolor{red!50!black}{gamma}' key of \txtspec{} set by the command \txtspecsty: \\ [2pt]\com{% \txtshadecom(380,780){myShadeA}% \\ \txtshadetikz{myShadeA}{0,0}{10,.5}% }{% \makebox[\linewidth][c]{\includegraphics{figsManual/tikzshade1.pdf}}% }% \\ \com{% \txtspecstyle[gamma=2]% \\ \txtshadecom(380,780){myShadeGammaII}% \\ \txtshadetikz{myShadeGammaII}{0,0}{10,.5}% }{% \makebox[\linewidth][c]{\includegraphics{figsManual/tikzshade2.pdf}}% }% \\ \com{% \txtspecstyle[gamma=10]% \\ \txtshadecom(380,780){myShadeGammaX}% \\ \txtshadetikz{myShadeGammaX}{0,0}{10,.5}% \\ \txtspecstylereset% }{% \makebox[\linewidth][c]{\includegraphics{figsManual/tikzshade3.pdf}}% }% \newpage% \subsection*{}\vspace{-22pt}{\normalfont\bfseries\raisebox{1.25pt}{$\mathbf{\blacktriangleright}$}\ Using \txtplotshadename{} and \txtplotmapname{} with \txtPGFPLOTS{}} \label{example:pgfspectraplots}\addcontentsline{toc}{subsection}{\texorpdfstring{Using \txtplotshadename{} and \txtplotmapname{} with \txtPGFPLOTS{}}{Using \textbackslash pgfspectraplotshade and \textbackslash pgfspectraplotmap with PGFPLOTS}}% \\ [4pt]\hypertarget{example:pgfspectraplots}{The command} \txtplotshadename{} is designed to build a shading to use with \txtPGFPLOTS{}. Next examples show a few possibilities of how it could be used regarding two \textit{sources}: a source of light and their photon flux and the blackbody spectral radiance. \\ [10pt]\tikz{\node[text width=\linewidth-6pt,inner sep=3pt,rounded corners=2pt,fill=orange!10,draw=orange!50,text justified] {In order to correctly make the filling between the path at axis and the plotted curve, the path should begin at 'shade begin' and end at 'shade end': \\ \textbf{\textbackslash path[name path=axis] (shade begin,0) -- (shade end,0);}};} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \vfill%\\ [6pt] \setbox0=\vbox{\begin{verbatim} \makebox[\linewidth][c]{% \fbox{\tikz{\fill[shading=visiblespectrum] (0,0) rectangle (7.5,.75);}}% }% \\ [10pt]\begin{tikzpicture} \begin{axis}[% title= Photon Flux,% xlabel={Wavelength [nm]},% ylabel={Photon Flux [a.u.]},% xmin=300,% xmax=800,% ]% \addplot[smooth, name path=spectrum,white] plot[] coordinates{% ( 380, 0 ) (400,5) ( 500, 1 ) ( 520, 3 ) ( 525, 8 ) ( 530, 25 ) ( 535, 23 ) ( 540, 28 ) ( 545, 34 ) ( 550, 20 ) ( 555, 13 ) ( 560, 8 ) ( 580, 9 ) ( 600, 18 ) ( 620, 7 ) ( 680, 1 ) ( 780, 0 ) }; \path[name path=axis] (380,0) -- (780,0); \addplot+ [thick,shading=visiblespectrum] fill between[of=spectrum and axis]; \end{axis} \end{tikzpicture}% \end{verbatim}}% \sectioncom{\txtplotshadecom{visiblespectrum}{\small\% default shading [380;780]nm}% \\ [-5pt]\tikz[overlay]{\fill[white,rounded corners=0pt] (-.3333em,0) rectangle (\linewidth+.3333em,-3pt);}% \\ \usebox0% }{% \ \\ [-5pt]\pgfspectraplotshade{visiblespectrum}% \makebox[\linewidth][c]{\fbox{\tikz{\fill[shading=visiblespectrum] (0,0) rectangle (7.5,.75);}}}% \\ [10pt]\makebox[\linewidth][c]{% \includegraphics{figsManual/pgfspectraplots1.pdf}% }}{.05\linewidth-.3333em}% \vfill% \newpage The above example could be obtained with the following \textit{improved} code, based on a suggestion made by Stefan Pinnow: \setbox0=\vbox{\begin{verbatim} \begin{tikzpicture} \pgfmathsetmacro{\xmin}{300} \pgfmathsetmacro{\xmax}{800} \pgfmathsetmacro{\shbegin}{380} \pgfmathsetmacro{\shend}{780} \pgfspectraplotshade[shade begin=\shbegin,shade end=\shend]{visiblespectrum} \begin{axis}[ title=Photon Flux, xlabel={Wavelength in nm}, ylabel={Photon Flux in a.u.}, xmin=\xmin, xmax=\xmax, ] \addplot [smooth, name path=spectrum,white] coordinates { (380,0) (400,5) (500,1) (520,3) (525,8) (530,25) (535,23) (540,28) (545,34) (550,20) (555,13) (560,8) (580,9) (600,18) (620,7) (680,1) (780,0) }; \path [name path=axis] (\shbegin,0) -- (\shend,0); \addplot+ [thick,shading=visiblespectrum] fill between [of=spectrum and axis]; \end{axis} \end{tikzpicture} \end{verbatim}}% \\ [6pt]\sectioncom{% \usebox0% }{% \ \\ [-5pt]% \makebox[\linewidth][c]{% \includegraphics{figsManual/Stefan1.pdf}% }}{.05\linewidth-.3333em}% % \newpage % \setbox0=\vbox{\begin{verbatim} \makebox[\linewidth][c]{% \fbox{\tikz{\fill[shading=visiblespectrum] (0,0) rectangle (7.5,.75);}}% }% \\ [10pt]\begin{tikzpicture} \begin{axis}[% title= Photon Flux,% xlabel={Wavelength [nm]},% ylabel={Photon Flux [a.u.]},% xmin=0,% xmax=1000,% ]% \addplot[smooth, name path=spectrum,white] plot[] coordinates{% ( 380, 0 ) (400,5) ( 500, 1 ) ( 520, 3 ) ( 525, 8 ) ( 530, 25 ) ( 535, 23 ) ( 540, 28 ) ( 545, 34 ) ( 550, 20 ) ( 555, 13 ) ( 560, 8 ) ( 580, 9 ) ( 600, 18 ) ( 620, 7 ) ( 680, 1 ) ( 780, 0 ) ( 800, 0) ( 900, 0) ( 1000, 0 ) }; \path[name path=axis] (380,0) -- (1000,0); \addplot+ [thick,shading=visiblespectrum] fill between[of=spectrum and axis]; \end{axis} \end{tikzpicture}% \end{verbatim}}% \sectioncom{\txtplotshadecomoption[shade end=1000]{visiblespectrum}%{\small\% COMMENTS}% \\ [-5pt]\tikz[overlay]{\fill[white,rounded corners=0pt] (-.3333em,0) rectangle (\linewidth+.3333em,-3pt);}% \\ \usebox0% }{% \ \\ [-5pt]\pgfspectraplotshade[shade end=1000]{visiblespectrum}% \makebox[\linewidth][c]{\fbox{\tikz{\fill[shading=visiblespectrum] (0,0) rectangle (7.5,.75);}}}% \\ [10pt]\makebox[\linewidth][c]{% \includegraphics{figsManual/pgfspectraplots2.pdf}% }}{.05\linewidth-.3333em}% % \\ [6pt]\setbox0=\vbox{\begin{verbatim} \makebox[\linewidth][c]{% \fbox{\tikz{\fill[shading=visiblespectrum] (0,0) rectangle (7.5,.75);}}% }% \\ [10pt]\\ \begin{tikzpicture} \begin{axis}[% title= Photon Flux,% xlabel={Wavelength [nm]},% ylabel={Photon Flux [a.u.]},% xmin=300,% xmax=600,% ]% \addplot[smooth, name path=spectrum,draw=none] plot[] coordinates{% ( 380, 0 ) (400,5) ( 500, 1 ) ( 520, 3 ) ( 525, 8 ) ( 530, 25 ) ( 535, 23 ) ( 540, 28 ) ( 545, 34 ) ( 550, 20 ) ( 555, 13 ) ( 560, 8 ) ( 580, 9 ) ( 600, 18 ) }; \path[name path=axis] (380,0) -- (600,0); \addplot+ [thick,shading=visiblespectrum] fill between[of=spectrum and axis]; \end{axis} \end{tikzpicture}% \end{verbatim}}% \sectioncom{\txtplotshadecomoption[shade end=600]{visiblespectrum}%{\small\% COMMENTS}% \\ [-5pt]\tikz[overlay]{\fill[white,rounded corners=0pt] (-.3333em,0) rectangle (\linewidth+.3333em,-3pt);}% \\ \usebox0% }{% \ \\ [-5pt]\pgfspectraplotshade[shade end=600]{visiblespectrum}% \makebox[\linewidth][c]{\fbox{\tikz{\fill[shading=visiblespectrum] (0,0) rectangle (7.5,.75);}}}% \\ [10pt]\makebox[\linewidth][c]{% \includegraphics{figsManual/pgfspectraplots3.pdf}% }}{.05\linewidth-.3333em}% % \\ [6pt]\setbox0=\vbox{\begin{verbatim} \makebox[\linewidth][c]{% \fbox{\tikz{\fill[shading=visiblespectrumGammaX] (0,0) rectangle (7.5,.75);}}% }% \\ [10pt]\\ \begin{tikzpicture} \begin{axis}[% title= Photon Flux,% xlabel={Wavelength [nm]},% ylabel={Photon Flux [a.u.]},% xmin=300,% xmax=800,% ]% \addplot[smooth, name path=spectrum,white] plot[] coordinates{% ( 380, 0 ) (400,5) ( 500, 1 ) ( 520, 3 ) ( 525, 8 ) ( 530, 25 ) ( 535, 23 ) ( 540, 28 ) ( 545, 34 ) ( 550, 20 ) ( 555, 13 ) ( 560, 8 ) ( 580, 9 ) ( 600, 18 ) ( 620, 7 ) ( 680, 1 ) ( 780, 0 ) }; \path[name path=axis] (380,0) -- (780,0); \addplot+ [thick,shading=visiblespectrumGammaX] fill between[of=spectrum and axis]; \end{axis} \end{tikzpicture}% \end{verbatim}}% \sectioncom{\txtplotshadecomoption[gamma=10]{visiblespectrumGammaX}%{\small\% COMMENTS}% \\ [-5pt]\tikz[overlay]{\fill[white,rounded corners=0pt] (-.3333em,0) rectangle (\linewidth+.3333em,-3pt);}% \\ \usebox0% }{% \ \\ [-5pt]\pgfspectraplotshade[gamma=10]{visiblespectrumGammaX}% \makebox[\linewidth][c]{\fbox{\tikz{\fill[shading=visiblespectrumGammaX] (0,0) rectangle (7.5,.75);}}}% \\ [10pt]\makebox[\linewidth][c]{% \includegraphics{figsManual/pgfspectraplots4.pdf}% }}{.05\linewidth-.3333em}% % \newpage\textbf{Note: when setting the color for IR or UV within \txtplotshadename{} make sure it doesn't end with `!' like `black!40'; use `black!40!white' instead}. % \\ [6pt]\setbox0=\vbox{\begin{verbatim} \makebox[\linewidth][c]{% \fbox{\tikz{\fill[shading=visiblespectrumIRUV] (0,0) rectangle (7.5,.75);}}% }% \\ [10pt]\\ \begin{tikzpicture} \begin{axis}[% title= Photon Flux,% xlabel={Wavelength [nm]},% ylabel={Photon Flux [a.u.]},% xmin=300,% xmax=900,% ]% \addplot[smooth, name path=spectrum,white] plot[] coordinates{% ( 300 , 0) (320, 15) (340, 1) (365, 1) ( 380, 2.5 ) (400,5) ( 500, 1 ) ( 520, 3 ) ( 525, 8 ) ( 530, 25 ) ( 535, 23 ) ( 540, 28 ) ( 545, 34 ) ( 550, 20 ) ( 555, 13 ) ( 560, 8 ) ( 580, 9 ) ( 600, 18 ) ( 620, 7 ) ( 680, 1 ) ( 780, 0 ) ( 800, 2 ) (825, 12) (850, 3) ( 900, 0 ) }; \path[name path=axis] (300,0) -- (900,0); \addplot+ [thick,shading=visiblespectrumIRUV] fill between[of=spectrum and axis]; \end{axis} \end{tikzpicture}% \end{verbatim}}% \sectioncom{\txtplotshadecomoption[IRcolor=black!40!white,UVcolor=black!60!white,shade begin=300,shade end=900]{visiblespectrumIRUV}%{\small\% COMMENTS}% \\ [-5pt]\tikz[overlay]{\fill[white,rounded corners=0pt] (-.3333em,0) rectangle (\linewidth+.3333em,-3pt);}% \\ \usebox0% }{% \ \\ [-5pt]\pgfspectraplotshade[IRcolor=black!40!white,UVcolor=black!60!white,shade begin=300,shade end=900]{visiblespectrumIRUV}% \makebox[\linewidth][c]{\fbox{\tikz{\fill[shading=visiblespectrumIRUV] (0,0) rectangle (7.5,.75);}}}% \\ [10pt]\makebox[\linewidth][c]{% \includegraphics{figsManual/pgfspectraplots5.pdf}% }}{.05\linewidth-.3333em}% % \newpage For the \textit{blackbody spectral radiance}, the Planck's distribution is used with the values: \small\begin{itemize} \item $\mathsf{c=3\times10^{14}\,microns\cdot s^{-1}}$ -- speed of light \item $\mathsf{h=6.626\times10^{22}\,kg\cdot microns^2\cdot s^{-1}}$ -- Planck constant \item $\mathsf{k_B=1.38\times10^{-11}\,kg\cdot microns^2\cdot s^{-2}\cdot K^{-1}}$ -- Boltzmann constant \item $\mathsf{\lambda}$ -- wavelength ($\mathsf{microns}$) \item $\mathsf{T}$ -- temperature ($\mathsf{K}$) \item Planck distribution: $\mathsf{B_\lambda=2hc^2\frac{1}{\lambda^5e^{\frac{hc}{\lambda k_BT}-1}}}$ ($\mathsf{kW\cdot sr^{-1}\cdot m^{-1}\cdot nm^{-1}}$) \end{itemize}\normalsize The legend of the plots is created with the following definition: \\ [-10pt]\small\begin{verbatim} \def\myentry#1{\tempercolor{#1}% \tikz{\fill[tempercolor] (0,-.5pt) rectangle (40pt,.5pt) node[midway,font=\footnotesize,anchor=mid] {\color{black} T=#1\hspace{.1ex}K};}}% \end{verbatim}\normalsize% % \vspace{6pt}\setbox0=\vbox{\begin{verbatim} \makebox[\linewidth][c]{% \fbox{\tikz{\fill[shading=BBody] (0,0) rectangle (7.5,.75);}}% }% \\ [10pt]\\ \begin{tikzpicture} \begin{axis}[title=Blackbody,xlabel={Wavelength ($\mathsf{\times10^3\,nm}$)},% ylabel={Spectral radiance\\ $\mathsf{(kW\cdot sr^{-1}\cdot m^{-2}\cdot nm^{-1})}$},% ylabel style={align=center},ymax=80,domain=0:4]% \addplot[smooth, name path=spectrum,black,samples=50,thick] plot[] {119.268/(x^5*(exp(14404/(x*7000))-1))};\addlegendentry{\myentry{7000}}% \addplot[smooth,black,samples=50,densely dashed,thick] plot[] {119.268/(x^5*(exp(14404/(x*5500))-1))};\addlegendentry{\myentry{5500}}% \addplot[smooth,black,samples=50,densely dotted,thick] plot[] {119.268/(x^5*(exp(14404/(x*4000))-1))};\addlegendentry{\myentry{4000}}% \path[name path=axis] (axis cs:0,0) -- (axis cs:1,0); \addplot+ [white,shading=BBody] fill between[of=spectrum and axis]; \end{axis}\end{tikzpicture}% \end{verbatim}}% \sectioncom{\txtplotshadecomoption[shade begin=0,shade end=4000,IRcolor=white,UVcolor=white, gamma=.6,shade opacity=.2]{BBody}%{\small\% COMMENTS}% \\ [-5pt]\tikz[overlay]{\fill[white,rounded corners=0pt] (-.3333em,0) rectangle (\linewidth+.3333em,-3pt);}% \\ \usebox0% }{% \ \\ [-5pt]\pgfspectraplotshade[shade begin=0,shade end=4000,shade opacity=.2,gamma=.6,IRcolor=white,UVcolor=white]{BBody}% \makebox[\linewidth][c]{\fbox{\tikz{\fill[shading=BBody] (0,0) rectangle (7.5,.75);}}}% \\ [10pt]\makebox[\linewidth][c]{% \includegraphics{figsManual/pgfspectraplots6.pdf}% }}{.05\linewidth-.3333em}% % \\ [6pt]\sectioncom{\txtplotshadecomoption[shade begin=0,shade end=4000,shade opacity=.2, gamma=.6]{BBody}%{\small\% COMMENTS}% \\ [-5pt]\tikz[overlay]{\fill[white,rounded corners=0pt] (-.3333em,0) rectangle (\linewidth+.3333em,-3pt);}% \\ \usebox0% }{% \ \\ [-5pt]\pgfspectraplotshade[shade begin=0,shade end=4000,shade opacity=.2, gamma=.6]{BBody}% \makebox[\linewidth][c]{\fbox{\tikz{\fill[shading=BBody] (0,0) rectangle (7.5,.75);}}}% \\ [10pt]\makebox[\linewidth][c]{% \includegraphics{figsManual/pgfspectraplots7.pdf}% }}{.05\linewidth-.3333em}% % \setbox0=\vbox{\begin{verbatim} \makebox[\linewidth][c]{% \fbox{\tikz{\fill[shading=BBody] (0,0) rectangle (7.5,.75);}}% }% \\ [10pt]\\ \begin{tikzpicture} \begin{axis}[ axis background/.style={fill=black},% legend style={fill=black,draw=white},% title=Blackbody,xlabel={Wavelength ($\mathsf{\times10^3\,nm}$)},% ylabel={Spectral radiance\\ $\mathsf{(kW\cdot sr^{-1}\cdot m^{-2}\cdot nm^{-1})}$},% ylabel style={align=center},ymax=80,domain=0:4]% \addplot[smooth, name path=spectrum,black,samples=50,thick] plot[] {119.268/(x^5*(exp(14404/(x*7000))-1))};\addlegendentry{\myentry{7000}}% \addplot[smooth,black,samples=50,densely dashed,thick] plot[] {119.268/(x^5*(exp(14404/(x*5500))-1))};\addlegendentry{\myentry{5500}}% \addplot[smooth,black,samples=50,densely dotted,thick] plot[] {119.268/(x^5*(exp(14404/(x*4000))-1))};\addlegendentry{\myentry{4000}}% \path[name path=axis] (axis cs:0,0) -- (axis cs:1,0); \addplot+ [black,shading=BBody] fill between[of=spectrum and axis]; \end{axis}\end{tikzpicture}% \end{verbatim}}% \\ [6pt]\sectioncom{\txtplotshadecomoption[shade begin=0,shade end=4000,IRcolor=black,UVcolor=black, gamma=.6,shade opacity=.5,shade opacity color=black]{BBody}%{\small\% COMMENTS}% \\ [-5pt]\tikz[overlay]{\fill[white,rounded corners=0pt] (-.3333em,0) rectangle (\linewidth+.3333em,-3pt);}% \\ \usebox0% }{% \ \\ [-5pt]\pgfspectraplotshade[shade begin=0,shade end=4000,IRcolor=black,UVcolor=black,shade opacity=.5,gamma=.6,shade opacity color=black]{BBody}% \makebox[\linewidth][c]{\fbox{\tikz{\fill[shading=BBody] (0,0) rectangle (7.5,.75);}}}% \\ [10pt]\makebox[\linewidth][c]{% \includegraphics{figsManual/pgfspectraplots8.pdf}% }}{.05\linewidth-.3333em}% % \\ [6pt]\sectioncom{\txtplotshadecomoption[shade begin=0,shade end=4000,shade opacity=.5, gamma=.6,shade opacity color=black]{BBody}%{\small\% COMMENTS}% \\ [-5pt]\tikz[overlay]{\fill[white,rounded corners=0pt] (-.3333em,0) rectangle (\linewidth+.3333em,-3pt);}% \\ \usebox0% }{% \ \\ [-5pt]\pgfspectraplotshade[shade begin=0,shade end=4000,shade opacity=.5,gamma=.6,shade opacity color=black]{BBody}% \makebox[\linewidth][c]{\fbox{\tikz{\fill[shading=BBody] (0,0) rectangle (7.5,.75);}}}% \\ [10pt]\makebox[\linewidth][c]{% \includegraphics{figsManual/pgfspectraplots9.pdf}% }}{.05\linewidth-.3333em}% % \newpage% The above examples could be obtained with a much functional and prettier code, also proposed by Stefan Pinnow: \small\setbox0=\vbox{\begin{verbatim} \begin{tikzpicture}[ /pgf/declare function={ BlackBodySpectralRadiance(\x,\T) = 119.268/(x^5*(exp(14404/(\x*\T))-1)); }, ] \pgfspectraplotshade[ shade begin=0, shade end=4000, IRcolor=white, UVcolor=white, gamma=.6, shade opacity=.2, ]{BBody} \def\myentry#1{\tempercolor{#1}% \tikz{\fill [tempercolor] (0,-.5pt) rectangle (40pt,.5pt) node [midway,font=\footnotesize,anchor=mid] {\color{black} $T = #1\,\mathrm{K}$};}% } \begin{axis}[ title=Blackbody, xlabel={Wavelength in $\mathrm{10^3\,nm}$}, ylabel={% Spectral radiance in\\ $\mathrm{kW\cdot sr^{-1}\cdot m^{-2}\cdot nm^{-1}}$% }, ylabel style={align=center}, ymax=80, cycle list name=linestyles, domain=0:4, samples=51, smooth, ] \pgfplotsinvokeforeach{7000,5500,4000}{ \addplot+ [thick,name path=spectrum-#1] {BlackBodySpectralRadiance(x,#1)}; \addlegendentry{\myentry{#1}} } \path [name path=axis] (axis cs:0,0) -- (axis cs:4,0); \addplot [shading=BBody] fill between [of=spectrum-7000 and axis]; \end{axis} \end{tikzpicture} \end{verbatim}}\normalsize% \\ [6pt]\sectioncom{\usebox0% }{% \ \\ [-5pt]\makebox[\linewidth][c]{% \includegraphics[width=63.5mm]{figsManual/Stefan2.pdf}% }\vspace{-4pt}}{.05\linewidth-.3333em}% % \newpage% The \textcolor{red!50!black}{logarithmic} option of the \txtplotshadename{} command could be used as a possible solution for the \textcolor{purple}{TeX - LaTeX Stack Exchange} question, \href{https://tex.stackexchange.com/q/348491/95441}{How to create a electromagnetic spectrum using pgfplots package (together with colormaps)}. \vfill%\\ [4pt] \small\setbox0=\vbox{\textit{\bfseries\textcolor{teal}{Filling optical spectrum curve with color gradient (first answer)}}\vskip3pt% \textcolor{green!70!black}{The original code lines that was replaced, in this possible answer, are commented.}\vskip-3pt% \begin{verbatim} \documentclass[12pt]{article} \usepackage[dvipsnames,table]{xcolor} \usepackage{siunitx} % SI-units \usepackage{pgf-spectra} \usepackage{pgfplots} \usepgfplotslibrary{units} % to add units easily to axis \usepgfplotslibrary{fillbetween} % to fill inbetween curves \usepgfplotslibrary{colormaps} % to create colormaps \pgfplotsset{width=12.2cm, height=7cm} \pgfplotsset{compat=newest} %(making it only compatalbe with %new releases of pgfplots) %\pgfdeclarehorizontalshading{visiblelight}{50bp}{ %color(0.00000000000000bp)=(violet); %color(8.33333333333333bp)=(blue); %color(16.66666666666670bp)=(cyan); %color(25.00000000000000bp)=(green); %color(33.33333333333330bp)=(yellow); %color(41.66666666666670bp)=(orange); %color(50.00000000000000bp)=(red) %}% % % make the horizontal shading and set the UV and IR colors --> %\pgfspectraStyle[gamma=.6]% uncomment to change the gamma \wlcolor{380}\colorlet{UV}{wlcolor}% \wlcolor{780}\colorlet{IR}{wlcolor}% \pgfspectraplotshade[logarithmic, UVcolor=UV]{logvisiblelight} \pgfspectraplotshade{visiblelight} %\pgfspectraStyleReset% uncomment to reset the style \begin{document} \begin{tikzpicture}[fill between/on layer={axis grid}] \begin{axis}[ xlabel={Wavelength}, xticklabel style = {font=\tiny,yshift=0.2ex}, xmin=10^-5, xmax=10^9, x unit=\si{\micro\meter}, xmode=log, ymin=0, ymax=1, height=3cm, yticklabels={}, ytick=\empty, legend cell align=left, legend style={at={(0.85,-0.77)},anchor=north} ] \end{verbatim}}% \setbox1=\vbox{\begin{verbatim} \addplot[draw=none, name path=start, forget plot] coordinates{(10^-5,0)(10^-5,1)}; \addplot[draw=none, name path=gamma, forget plot] coordinates{(10^-3,0)(10^-3,1)}; \addplot[draw=none, name path=xrays, forget plot] coordinates{(10^-2,0)(10^-2,1)}; %\addplot[draw=none, name path=uv, forget plot] coordinates{(0.4,0)(0.4,1)}; \addplot[draw=none, name path=uv, forget plot] coordinates{(0.38,0)(0.38,1)}; %\addplot[draw=none, name path=visible, forget plot] coordinates{(0.7,0)(0.7,1)}; \addplot[draw=none, name path=visible, forget plot] coordinates{(0.78,0)(0.78,1)}; \addplot[draw=none, name path=ir, forget plot] coordinates{(10^2.5,0)(10^2.5,1)}; \addplot[draw=none, name path=microwave, forget plot] coordinates{(10^5,0)(10^5,1)}; \addplot[draw=none, name path=radiowave, forget plot] coordinates{(10^9,0)(10^9,1)}; \addplot[violet!20, area legend] fill between[of=start and gamma]; \addlegendentry{$\gamma$-ray} \addplot[violet!60, area legend] fill between[of=gamma and xrays]; \addlegendentry{X-ray} %\addplot[violet, area legend] fill between[of=xrays and uv]; \addplot[UV!50,area legend] fill between[of=xrays and uv]; \addlegendentry{Ultra violet} \addplot[shading=visiblelight, area legend] fill between[of=uv and visible]; \addlegendentry{Visible light}%makes the correct legend (not logarithmic) \addplot[shading=logvisiblelight,forget plot] fill between[of=uv and visible]; %\addplot[red, area legend] fill between[of=visible and ir]; \addplot[IR!50,area legend] fill between[of=visible and ir]; \addlegendentry{Infrared} %\addplot[Bittersweet, area legend] fill between[of=ir and microwave]; \addplot[IR!50!Bittersweet, area legend] fill between[of=ir and microwave]; \addlegendentry{Micro wave} \addplot[Brown, area legend] fill between[of=microwave and radiowave]; \addlegendentry{Radio wave} \end{axis} \end{tikzpicture} \end{document} \end{verbatim}}\normalsize% \bigsectioncom{\usebox0}{\usebox1}% {% \ \\ [-5pt]\makebox[\linewidth][c]{% \includegraphics[width=.9\linewidth]{figsManual/SEexchange.pdf}% }}{.05\linewidth-.3333em}% % \newpage \small\setbox0=\vbox{\textit{\bfseries\textcolor{teal}{Filling optical spectrum curve with color gradient (second answer)}}\vskip3pt% \textcolor{green!70!black}{The original code lines that was replaced, in this possible answer, are commented and the\\ code without changes was omitted.}\vskip-3pt% \begin{verbatim} \documentclass{article} \usepackage{tikz} \usetikzlibrary{calc, positioning, shapes, backgrounds, fit, arrows} \usepackage{pgf-spectra} \usepackage{siunitx} \usepackage{contour} \begin{document} %\pgfdeclarehorizontalshading{visiblelight}{50bp}{% %https://tex.stackexchange.com/a/348492/120853 % color(0bp)=(violet!25); % color(8.33bp)=(blue!25); % color(16.67bp)=(cyan!25); % color(25bp)=(green!25); % color(33.33bp)=(yellow!25); % color(41.5bp)=(orange!25); % color(50bp)=(red!25) %}% % % make the horizontal shading and set the UV and IR colors --> %\pgfspectraStyle[gamma=.6]% uncomment to change the gamma \wlcolor{380}\colorlet{UV}{wlcolor}% \wlcolor{780}\colorlet{IR}{wlcolor}% \pgfspectraplotshade[logarithmic,shade opacity=.3]{visiblelight}% %\pgfspectraStyleReset% uncomment to reset the style \begin{tikzpicture}[% raylabel/.style={font=\scriptsize} ] % ... code omitted ... % % On background layer so already drawn arrow and scale lines cover it up nicely \begin{scope}[on background layer] \node[ inner sep=0pt, outer sep=0pt, %fit={([xshift=-2.2em]WAVELENGTH_0|-ARROW.after tail) %([xshift=-2.2em]WAVELENGTH_1|-ARROW.before tail)}, shading=visiblelight] fit={([xshift=-1.9em]WAVELENGTH_0|-ARROW.after tail) ([xshift=-3em]WAVELENGTH_1|-ARROW.before tail)}, shading=visiblelight]% (SMALL_VISIBLE_LIGHT) {}; \shade[ left color=white, %right color=violet!25, right color=UV!25, %middle color=violet!5, middle color=UV!5, outer sep=0pt ] % ... code omitted ... % \shade[ %left color=red!25, left color=IR!25, right color=white, %middle color=red!5, middle color=IR!5, outer sep=0pt, ] % ... code omitted ... % \end{scope} \end{verbatim}\vspace{-6pt}}% \setbox1=\vbox{\begin{verbatim} % Some labels can be drawn automatically at the designated label coordinates: \foreach [count=\i] \label in { {Gamma\\rays}, {X-rays}, {},%Skip this one {infrared} }{ \node[raylabel, align=center] at (LABEL_\i) {\label}; } % These do not fit the loop and are drawn manually: \node[raylabel, align=right, anchor=north] at ([yshift=-1em,xshift=-2.5pt]$(WAVELENGTH_-2)!0.45!(WAVELENGTH_0)$) {Ultra-\\violet}; \node[raylabel, fill=white] at (CONNECTION_6) {radio waves}; \node[raylabel, left=0.1em of CONNECTION_1, align=right] {cosmic\\rays}; \node[ draw, fill=black!20, below=4em of SMALL_VISIBLE_LIGHT, align=center, label=above:{\textbf{Visible Spectrum}} ] (FULL_VISIBLE_LIGHT) {% %\pgfspectra[width=13em,height=3em]\\ \pgfspectra[width=13em,height=3em,axis,axis unit=micron,axis step=100, axis ticks=4,axis unit precision=2]\\% %pgfspectra also has a builtin axis which of course much better than %this terrible approach, but it is in nanometer {\num{0.38} \hfill\num{0.48} \hfill\num{0.58}% \hfill \num{0.68} \hfill\num{0.78}}\\ }; % ... code omitted ... % \end{tikzpicture} \end{document} \end{verbatim}}\normalsize% \bigsectioncom{\usebox0}{\usebox1}% {% \ \\ [-5pt]\makebox[\linewidth][c]{% \includegraphics[width=.9\linewidth]{figsManual/SExchange.pdf}% }}{.05\linewidth-.3333em}% % \newpage %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Next examples show possible usage of \textsf{\large color maps} feature of \txtPGFPLOTS{} with the color map build with the \txtplotmapname{} command: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \\ [6pt]\setbox0=\vbox{\footnotesize\begin{verbatim} \pgfplotscolorbardrawstandalone[colormap={example}% {samples of colormap=(10 of myColorMap)}, colorbar horizontal,colormap access=const] \\ \pgfplotscolorbardrawstandalone[colormap={example}% {samples of colormap=(10 of myColorMap)}, colorbar horizontal,colormap access=map] % --- code improved by Stefan Pinnow ---> \begin{tikzpicture} \foreach \i [ evaluate=\i as \x using {int(mod(\i,15))}, evaluate=\i as \y using {floor(\i/15)}, ] in {0,...,\pgfplotscolormaplastindexof{myColorMap}}{ \fill [index of colormap={\i of myColorMap}] (\x*12pt,-\y*10pt) rectangle ++(12pt,10pt) node [inner sep=0pt,midway,font=\tiny,text=white] {\i}; } \end{tikzpicture} \end{verbatim}}% \sectioncom{\txtplotmapcom{myColorMap}{\small\% default resolution (51 colors)}% \\ [-5pt]\tikz[overlay]{\fill[white,rounded corners=0pt] (-.3333em,0) rectangle (\linewidth+.3333em,-3pt);}% \\ \usebox0% }{% \ \\ [-10pt]\makebox[\linewidth][c]{% \includegraphics[scale=1.2]{figsManual/colormap1.pdf}% }% \\ [2pt]\makebox[\linewidth][c]{% \includegraphics[scale=1.2]{figsManual/colormap2.pdf}% }% \\ [2pt]\makebox[\linewidth][c]{% \includegraphics[scale=1.2]{figsManual/colormap3.pdf}% }}{.05\linewidth-.3333em}% %%%% \vfill%\\ [6pt] \setbox0=\vbox{\footnotesize\begin{verbatim} \pgfplotscolorbardrawstandalone[colormap={example}% {samples of colormap=(10 of myColorMapH)}, colorbar horizontal,colormap access=const] \\ \pgfplotscolorbardrawstandalone[colormap={example}% {samples of colormap=(10 of myColorMapH)}, colorbar horizontal,colormap access=map] % --- code improved by Stefan Pinnow ---> \begin{tikzpicture} \foreach \i [ evaluate=\i as \x using {int(mod(\i,15))}, evaluate=\i as \y using {floor(\i/15)}, ] in {0,...,\pgfplotscolormaplastindexof{myColorMap}}{ \fill [index of colormap={\i of myColorMap}] (\x*12pt,-\y*10pt) rectangle ++(12pt,10pt) node [inner sep=0pt,midway,font=\tiny,text=white] {\i}; } \end{tikzpicture} \end{verbatim}}% \sectioncom{\txtplotmapcomoption[h]{myColorMap}{\small\% high resolution (401 colors)% \\ \% color(0) -> 380nm color(1) -> 381nm ... color(60) -> 380+60=440nm ... % \\ \%\phantom{color(0) -> 380nm color(1)} ... color(400) -> 780nm}% \\ [-5pt]\tikz[overlay]{\fill[white,rounded corners=0pt] (-.3333em,0) rectangle (\linewidth+.3333em,-3pt);}% \\ \usebox0% }{% \ \\ [-10pt]\makebox[\linewidth][c]{% \includegraphics[scale=1.2]{figsManual/colormap4.pdf}% }% \\ [2pt]\makebox[\linewidth][c]{% \includegraphics[scale=1.2]{figsManual/colormap5.pdf}% }% \\ [2pt]\makebox[\linewidth][c]{% \includegraphics[scale=1.2]{figsManual/colormap6.pdf}% }}{.05\linewidth-.3333em}% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \newpage\vfill% \subsection*{}\vspace{-22pt}{\normalfont\bfseries\raisebox{1.25pt}{$\mathbf{\blacktriangleright}$}\ Using \txtrainbowname} \label{example:rainbow}\addcontentsline{toc}{subsection}{\texorpdfstring{Using \txtrainbowname}{Using \textbackslash pgfspectrarainbow}}% \\ [4pt]\hypertarget{example:rainbow}{Here are} some examples of rainbows: \\ [4pt]\sectioncom{\txtrainbowcom{1cm} }{% \\ [2pt]\makebox[\linewidth][c]{% \includegraphics{figsManual/arcoiris1.pdf}% }}{.05\linewidth-.3333em}% %\\ \pgfspectrarainbow{1cm}%1 \vfill% \sectioncom{\txtrainbowcomoptionrainbow(rainbow start=0){1cm} }{% \\ \makebox[\linewidth][c]{% \includegraphics{figsManual/arcoiris2.pdf}% }}{.05\linewidth-.3333em}% %\\ \pgfspectrarainbow(rainbow start=0){1cm}%2 \vfill% \sectioncom{\txtrainbowcomoptionrainbow(rainbow start=.4){1cm} }{% \\ \makebox[\linewidth][c]{% \includegraphics{figsManual/arcoiris3.pdf}% }}{.05\linewidth-.3333em}% %\\ \pgfspectrarainbow(rainbow start=.4){1cm}%3 \vfill% \sectioncom{\txtrainbowcomoptionrainbow(rainbow start=.8){1cm} }{% \\ \makebox[\linewidth][c]{% \includegraphics{figsManual/arcoiris4.pdf}% }}{.05\linewidth-.3333em}% %\\ \pgfspectrarainbow(rainbow start=.8){1cm}%4 %\newpage \vfill% \sectioncom{\txtrainbowcomoptionrainbow(rainbow knock out=.8){1cm} }{% \\ \makebox[\linewidth][c]{% \includegraphics{figsManual/arcoiris5.pdf}% }}{.05\linewidth-.3333em}% %\\ \pgfspectrarainbow(rainbow knock out=.8){1cm}%5 \vfill% \sectioncom{\txtrainbowcomoptionrainbow(rainbow knock out=0){1cm} }{% \\ \makebox[\linewidth][c]{% \includegraphics{figsManual/arcoiris6.pdf}% }}{.05\linewidth-.3333em}% %\\ \pgfspectrarainbow(rainbow knock out=0){1cm}%6 \vfill% \sectioncom{\txtrainbowcomoptionrainbow(rainbow knock out=-.8){1cm} }{% \\ \makebox[\linewidth][c]{% \includegraphics{figsManual/arcoiris7.pdf}% }}{.05\linewidth-.3333em}% %\\ \pgfspectrarainbow(rainbow knock out=-.8){1cm}%7 \vfill% \sectioncom{\txtrainbowcomoptionrainbow(rainbow transparency=.5){1cm} }{% \\ \makebox[\linewidth][c]{% \includegraphics{figsManual/arcoiris8.pdf}% }}{.05\linewidth-.3333em}% %\\ \pgfspectrarainbow(rainbow transparency=.5){1cm}%8 \vfill% \sectioncom{\txtrainbowcomoptionrainbow(rainbow background=white){1cm} }{% \\ \makebox[\linewidth][c]{% \includegraphics{figsManual/arcoiris9.pdf}% }}{.05\linewidth-.3333em}% %\\ \pgfspectrarainbow(rainbow background=white){1cm}%9 \vfill% \sectioncom{\txtrainbowcomoptionrainbow(rainbow background=blue,rainbow transparency=.5){1cm} }{% \\ \makebox[\linewidth][c]{% \includegraphics{figsManual/arcoiris10.pdf}% }}{.05\linewidth-.3333em}% %\\ \pgfspectrarainbow(rainbow background=blue,rainbow transparency=.5){1cm}%10 \newpage%\vfill% \sectioncom{\txtrainbowcomoptionrainbow(rainbow background=black,rainbow transparency=.5){1cm} }{% \\ \makebox[\linewidth][c]{% \includegraphics{figsManual/arcoiris11.pdf}% }}{.05\linewidth-.3333em}% %\\ \pgfspectrarainbow(rainbow background=black,rainbow transparency=.5){1cm}%11 \vfill% \sectioncom{\txtrainbowcomoptionrainbow(rainbow background=white,rainbow transparency=.5){1cm} }{% \\ \makebox[\linewidth][c]{% \includegraphics{figsManual/arcoiris12.pdf}% }}{.05\linewidth-.3333em}% %\\ \pgfspectrarainbow(rainbow background=white,rainbow transparency=.5){1cm}%12 \vfill% \sectioncom{\txtrainbowcomoptionrainbow(rainbow fade=south){1cm} }{% \\ \makebox[\linewidth][c]{% \includegraphics{figsManual/arcoiris13.pdf}% }}{.05\linewidth-.3333em}% %\\ \pgfspectrarainbow(rainbow fade=south){1cm}%13 \vfill% \sectioncom{\txtrainbowcomoptionrainbow(rainbow fade=north){1cm} }{% \\ \makebox[\linewidth][c]{% \includegraphics{figsManual/arcoiris14.pdf}% }}{.05\linewidth-.3333em}% %\\ \pgfspectrarainbow(rainbow fade=north){1cm}%14 %\newpage% \vfill% \sectioncom{\txtrainbowcomoptiontikz[white,path fading=south]{1cm} }{% \\ \makebox[\linewidth][c]{% \includegraphics{figsManual/arcoiris15.pdf}% }}{.05\linewidth-.3333em}% %\\ \pgfspectrarainbow[white,path fading=south]{1cm}%15 %\\ [6pt]% \vfill% \sectioncom{\txtrainbowcomoptions[white](rainbow fade=south){1cm} }{% \\ \makebox[\linewidth][c]{% \includegraphics{figsManual/arcoiris16.pdf}% }}{.05\linewidth-.3333em}% %\\ \pgfspectrarainbow[white](rainbow fade=south){1cm}%16 %\\ [6pt]% \vfill% \sectioncom{\txtrainbowcomoptions[orange,path fading=west](rainbow fade=south){1cm} }{% \\ \makebox[\linewidth][c]{% \includegraphics{figsManual/arcoiris17.pdf}% }}{.05\linewidth-.3333em}% %\\ \pgfspectrarainbow[orange,path fading=west](rainbow fade=south){1cm}%17 %\\ [6pt]% \vfill% \sectioncom{\txtrainbowcomoptiontikz[blue,xslant=.1,opacity=.2]{1cm} }{% \\ \makebox[\linewidth][c]{% \includegraphics{figsManual/arcoiris18.pdf}% }}{.05\linewidth-.3333em}% \vfill% %\\ \pgfspectrarainbow[blue,xslant=.1,opacity=.2]{1cm}%18 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \newpage \section{Alphabetical list of available options} \makeatletter\colorlet{\@linkcolor}{red!50!black}\makeatother% % \pgfspectra \large\txtspec\normalsize \\ \header \\ [-1pt]\linhaimpar{\hyperlink{option:absorption}{absorption}}{minimum intensity for the lines in the spectrum when using their relative intensities}{boolean}{false}{\{true, false\}}% \\ [-1pt]\linhapar{\hyperlink{option:axis}{axis}}{show or hide the axis}{boolean}{false}{\{true, false\}}% \\ [-1pt]\linhaimpar{\hyperlink{option:axis color}{axis color}}{color of the axis}{color}{black}{any named color or user defined color}% \\ [-1pt]\linhapar{\hyperlink{option:axis font}{axis font}}{font of the axis labels}{font commands}{\{\textbackslash tiny\}}{\TeX\ font commands}% \\ [-1pt]\linhaimpar{\hyperlink{option:axis font color}{axis font color}}{color of the axis labels}{color}{white}{any named color or user defined color}% \\ [-1pt]\linhapar{\hyperlink{option:axis label}{axis label}}{shows or hides the axis label below it}{boolean}{false}{\{true, false\}}% \\ [-1pt]\linhaimpar{\hyperlink{option:axis label position}{axis label position}}{sets the position of the axis label}{text}{center}{left or center or right}% \\ [-1pt]\linhapar{\hyperlink{option:axis label text}{axis label text}}{if not empty, shows the axis label with the given text below it}{text}{\{\}}{}% \\ [-1pt]\linhaimpar{\hyperlink{option:axis step}{axis step}}{interval in nanometres between two major axis ticks}{integer}{20}{[0;|end-begin|]\hspace{.1pt}nm}% \\ [-1pt]\linhapar{\hyperlink{option:axis ticks}{axis ticks}}{number of minor ticks}{integer}{0}{\{0,1,2,3,\ldots\}}% \\ [-1pt]\linhaimpar{\hyperlink{option:axis unit}{axis unit}}{unit of the axis labels}{text}{nm}{nm or micron or A}% \\ [-1pt]\linhapar{\hyperlink{option:axis unit precision}{axis unit precision}}{number of significant digits (for values in nanometres) shown in axis labels}{integer}{3}{\{0,1,2,3,\ldots\}}% \\ [-1pt]\linhaimpar{\hyperlink{option:back}{back}}{spectrum background color}{color}{black}{any named color or user defined color}% \\ [-1pt]\linhapar{\hyperlink{option:backIRUV}{backIRUV}}{IR and UV emission lines color in emission spectrum or background color of IR and UV regions in absorption spectrum}{color}{black}{any named color or user defined color}% \\ [-1pt]\linhaimpar{\hyperlink{option:backVIS}{backVIS}}{visible region background color in emission spectrum or emission lines color in absorption spectrum}{color}{black}{any named color or user defined color}% \\ [-1pt]\linhapar{\hyperlink{option:begin}{begin}}{first wavelength, in nanometres}{integer}{380}{[10;4000]\hspace{.1pt}nm}% \\ [-1pt]\linhaimpar{\hyperlink{option:brightness}{brightness}}{brightness color correction as in the CMYK color model}{decimal}{1}{[0;1]}% \\ [-1pt]\linhapar{\hyperlink{option:charge}{charge}}{charge of the element(s)}{integer}{0}{LSE Data: \{0,1,2,3,4\} NIST Data: \{0,1\}}% \\ [-1pt]\linhaimpar{\hyperlink{option:element}{element}}{chemical symbol of one element or comma sparated list of chemical symbols elements}{text}{NONE}{H to Es except Fr}% \\ [-1pt]\linhapar{\hyperlink{option:end}{end}}{last wavelength, in nanometres}{integer}{780}{[10;4000]\hspace{.1pt}nm}% \\ [-1pt]\linhaimpar{\hyperlink{option:gamma}{gamma}}{gamma color correction at the edges of the visible region}{decimal}{0.8}{[0;1]}% \\ [-1pt]\linhapar{\hyperlink{option:height}{height}}{spectrum height}{length}{1cm}{up to maximum \TeX\ dimension (16384pt)}% \\ [-1pt]\linhaimpar{\hyperlink{option:Imin}{Imin}}{minimum intensity of the lines}{decimal}{0}{[0;1]}% \\ [-1pt]\linhapar{\hyperlink{option:IRcolor}{IRcolor}}{IR emission lines color in emission spectrum or background color of IR region in absorption spectrum}{color}{rgb(.3157,.2373,\vskip0pt.2373)}{any named color or user defined color}% \\ [-1pt]\linhaimpar{\hyperlink{option:label}{label}}{show or hide the axis labels}{boolean}{false}{\{true, false\}}% \\ [-1pt]\linhapar{\hyperlink{option:label after text}{label after text}}{extra text to place after the label of the spectrum}{text}{\{\}}{}% \\ [-1pt]\linhaimpar{\hyperlink{option:label before text}{label before text}}{extra text to place before the label of the spectrum}{text}{\{\}}{}% \\ [-1pt]\linhapar{\hyperlink{option:label font}{label font}}{font of the spectrum label}{font commands}{\{\textbackslash bfseries\textbackslash small\}}{}% \\ [-1pt]\linhaimpar{\hyperlink{option:label font color}{label font color}}{color of the font of the spectrum label}{color}{black}{any named color or user defined color}% \\ [-1pt]\linhapar{\hyperlink{option:label position}{label position}}{position of the label of the spectrum}{text}{\{west\}}{\{west, north west,\vskip0pt north, north east,\vskip0pt east, south east,\vskip0pt south, south west\}}% \newpage \large\txtspec\ (continuation)\normalsize \\ \header \\ [-1pt]\linhaimpar{\hyperlink{option:line intensity}{line intensity}}{draw all lines with the same intensity value}{integer}{100}{\{0,1,2,\dots,99,100\}}% \\ [-1pt]\linhapar{\hyperlink{option:linewidth}{line width}}{width of each line drawn in the spectrum}{length}{1pt}{up to maximum \TeX\ dimension (16384pt)}% \\ [-1pt]\linhaimpar{\hyperlink{option:lines}{lines}}{number or comma sparated list of numbers}{integer or decimal}{\{\}}{[10;4000]\hspace{.1pt}nm}% \\ [-1pt]\linhapar{\hyperlink{option:redshift}{redshift}}{computes and draws the redshifted (or blueshifted) lines}{text}{\{\}}{numeric value or \vskip0pt\{D=numeric value between [0;1]/any angle value in degrees\}}% \\ [-1pt]\linhaimpar{\hyperlink{option:relative intensity}{relative intensity}}{draws the lines using their relative intensities}{boolean}{false}{\{true, false\}}% \\ [-1pt]\linhapar{\hyperlink{option:relative intensity threshold}{relative intensity\vskip0pt threshold}}{all lines with intensity}{decimal}{0.25}{[0;1]}% \\ [-1pt]\linhaimpar{\hyperlink{option:show redshift value}{show redshift value}}{show or hide the redshift value}{boolean}{false}{\{true, false\}}% \\ [-1pt]\linhapar{\hyperlink{option:use visible shading}{use visible shading}}{visible region is drawn using a shading (instead of line by line)}{boolean}{true}{\{true, false\}}% \\ [-1pt]\linhaimpar{\hyperlink{option:UVcolor}{UVcolor}}{UV emission lines color in emission spectrum or background color of UV region in absorption spectrum}{color}{rgb(.3,.2568,.3)}{any named color or user defined color}% \\ [-1pt]\linhapar{\hyperlink{option:width}{width}}{spectrum width}{length}{\{0.9\textbackslash textwidth\}}{up to maximum \TeX\ dimension (16384pt)}% % \pgfspectradata \\ [10pt]\large\bs{pgfspectradata}\normalsize \\ \header\def\myast{ \raisebox{-4pt}{\large$\mathsf{^{^\ast}}$}} \\ [-1pt]\linhaimpar{\hyperlink{optionlib:precision}{precision}}{numerical precision of the data internally stored}{integer}{1}{non negative integer}% \\ [-1pt]\linhapar{\hyperlink{optionlib:unit}{unit}}{unit of the spectral lines data}{text}{\{\}}{nm or micron or A}% \\ [-1pt]\linhaimpar{\hyperlink{optionlib:begin}{begin}}{first wavelength, in nanometres}{integer}{380}{[10;4000]\hspace{.1pt}nm}% \\ [-1pt]\linhapar{\hyperlink{optionlib:charge}{charge\myast}}{charge of the element(s)}{integer}{0}{LSE Data: \{0,1,2,3,4\} NIST Data: \{0,1\}}% \\ [-1pt]\linhaimpar{\hyperlink{optionlib:element}{element\myast}}{chemical symbol of one element or comma sparated list of chemical symbols elements}{text}{NONE}{H to Es except Fr}% \\ [-1pt]\linhapar{\hyperlink{optionlib:end}{end\myast}}{last wavelength, in nanometres}{integer}{780}{[10;4000]\hspace{.1pt}nm}% \\ [-1pt]\linhaimpar{\hyperlink{optionlib:Imin}{Imin\myast}}{minimum intensity of the lines}{decimal}{0}{[0;1]}% \\ [-1pt]\linhapar{\hyperlink{optionlib:redshift}{redshift\myast}}{numerical precision of the data internally stored}{text}{\{\}}{numeric value or \vskip0pt\{D=numeric value between [0;1]/any angle value in degrees\}}% \\ \textit{\red{\myast{}}\footnotesize\ options shared with \txtspec{}}% % \pgfspectratable \\ [10pt]\large\bs{pgfspectratable}\normalsize \\ \header \\ [-1pt]\linhaimpar{\hyperlink{optionlib:backcolor}{back color}}{background color of the table header, of the \textit{element(s)} column, of the table border lines and of the lines between rows}{color}{black!10}{any named color or user defined color}% \\ [-1pt]\linhapar{\hyperlink{optionlib:databackcolor}{data back color}}{the background color of each data row}{color}{white}{any named color or user defined color}% \\ [-1pt]\linhaimpar{\hyperlink{optionlib:elementscolumnwidth}{elements column width}}{the width of the \textit{element(s)} column}{length}{2.5em}{up to maximum \TeX\ dimension (16384pt)}% \\ [-1pt]\linhapar{\hyperlink{optionlib:textcolor}{text color}}{the color of all text in the table}{color}{black}{any named color or user defined color}% \\ [-1pt]\linhaimpar{\hyperlink{optionlib:title}{title}}{the title in the table header}{text}{\\ SPECTRAL LINES OF ELEMENT(S) \ldots}{}% \\ [-1pt]\linhapar{\hyperlink{optionlib:width}{width}}{the total width of the table}{length}{\textbackslash linewidth}{up to maximum \TeX\ dimension (16384pt)}% % \pgfspectraplotshade \\ [10pt]\large\txtplotshadename\normalsize \\ \header \\ [-1pt]\linhaimpar{\hyperlink{option:shade begin}{shade begin}}{first wavelength, in nanometres}{integer}{380}{[0;15999]\hspace{.1pt}nm}% \\ [-1pt]\linhapar{\hyperlink{option:shade end}{shade end}}{last wavelength, in nanometres}{integer}{780}{[1;16000]\hspace{.1pt}nm}% \\ [-1pt]\linhaimpar{\hyperlink{option:shade opacity}{shade opacity}}{opacity of the computed shade}{decimal}{1}{[0;1]}% \\ [-1pt]\linhapar{\hyperlink{option:shade opacity color}{shade opacity color}}{background color of the computed shading}{color}{white}{any named color or user defined color}% \\ [-1pt]\linhaimpar{\hyperlink{option:logarithmic}{logarithmic}}{the shading is build in a logarithmic scale}{boolean}{false}{\{true, false\}}% % \pgfspectrarainbow \\ [10pt]\large\txtrainbowname\normalsize \\ \header \\ [-1pt]\linhaimpar{\hyperlink{option:rainbow background}{rainbow\vskip0pt background}}{background color below the rainbow}{color}{white}{any named color or user defined color}% \\ [-1pt]\linhapar{\hyperlink{option:rainbow fade}{rainbow fade}}{scope fading in the clipped region}{text}{\{\}}{any named \txttikz{} fading or user defined\vskip0pt fading}% \\ [-1pt]\linhaimpar{\hyperlink{option:rainbow knock out}{rainbow knock out}}{relative distance from the half-circle base to perform the clip}{decimal}{.4}{[-1;1]}% \\ [-1pt]\linhapar{\hyperlink{option:rainbow start}{rainbow start}}{fraction from which the rainbow colors begin, relative to the center of a circle with radius 1}{decimal}{.6}{[0;1]}% \\ [-1pt]\linhaimpar{\hyperlink{option:rainbow transparency}{rainbow\vskip0pt transparency}}{overall transparency of the rainbow}{decimal}{0}{[0;1]}% \makeatletter\colorlet{\@linkcolor}{black!50!green}\makeatother% \newpage \section{Recommendations and known issues} The code could be a bit slow, so if there are many spectra to draw, the time consumption to get them could be high. In that case it's preferable to compile individual spectrum via the \textit{preview} package, for later inclusion with \large\verb|\includegraphics{.pdf}|\normalsize: \begin{lstlisting} % .tex \documentclass{article} \usepackage{pgf-spectra} \usepackage[active,tightpage]{preview} \PreviewEnvironment{tikzpicture} \setlength\PreviewBorder{1pt}% %%%%%%%%%%%%%%%%% \begin{document} \pgfspectra[element=H,width=15cm] \end{document} \end{lstlisting} \vspace{18pt}\textit{Hint for \TeX\ `limits'}: \\ [2pt]\textsf{If tex capacity exceeded when running... \\ «! TeX capacity exceeded, sorry [main memory size=2000001].»} \\ [2pt]just make a \textsf{\textbackslash newpage} at the point of origin of the message (ejecting the page releases the \TeX\ memory!) \newpage\small% \printindex% \end{document} %\\ [18pt]\ % %\section{The code} %\lstinputlisting{pgf-spectra.sty}