Graphics, Figures & TablesHow can I plot ionization graphs in TikZ

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
luchito_92
Posts: 3
Joined: Mon Oct 10, 2016 7:01 am

How can I plot ionization graphs in TikZ

Post by luchito_92 »

I need draw these graphs in tikz, but i not have idea by begin :/
The graphs are:

1.- Variation of ionization cross-sections (left)
2.- Townsend first ionization coefficient (right)

Help pls... Ty

Image
Last edited by Stefan Kottwitz on Mon Feb 06, 2017 7:43 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
TikZ book
User avatar
Stefan Kottwitz
Site Admin
Posts: 10315
Joined: Mon Mar 10, 2008 9:44 pm

How can I plot ionization graphs in TikZ

Post by Stefan Kottwitz »

Hi,

welcome to the forum!

Do you have a formula for those functions?

I recommend to use pgfplots, that is based on TikZ. See http://pgfplots.net for examples.

Stefan
LaTeX.org admin
User avatar
Stefan Kottwitz
Site Admin
Posts: 10315
Joined: Mon Mar 10, 2008 9:44 pm

How can I plot ionization graphs in TikZ

Post by Stefan Kottwitz »

With pgfplots we can easily design the axes. Then we can draw the points with experimental data. The smooth option gives a smoother connection, like interpolated. Here is an example:

Code: Select all

\documentclass[border=5pt]{standalone}
\usepackage{pgfplots}
\pgfplotsset{width = 6cm, compat = newest}
\usepackage{sansmath}
\pgfplotsset{
  tick label style = { font=\tiny\sansmath\sffamily},
  label style      = { font=\small\sansmath\sffamily}
}
\begin{document}
\begin{tikzpicture}
  \begin{axis} [
      domain = 0:100,
      xlabel     = Electron energy,
      ylabel     = Ionization,
      axis lines = left,
      clip       = false, 
      xmin = 0,  xmax = 100,
      ymin = 0, ymax = 100,
      xtick={32,65},
      xticklabels={$10^1$,$10^2$},
      ytick={40,80},
      yticklabels={$10^1$,$10^2$},
    ]
    \addplot [smooth, dashed]
      coordinates { (5,4) (7,40) (10,60) (14,74) (20,84) (30,90)
                    (40,90) (50,87) (60,81) (65,76)};
    \addplot [smooth]
      coordinates { (8,10) (9,44) (12,64) (14,72) (20,82) (30,87)
                    (40,88) (50,85) (60,79) (65,74)};
    \addplot [smooth]
      coordinates { (10,5) (9,20) (9.3,40) (12,61) (15,69.5) (20,75) (30,77)
                    (40,73) (50,66) (60,58) (65,54)};
  \end{axis}
\end{tikzpicture}
\end{document}
plot.png
plot.png (16.01 KiB) Viewed 7010 times
To get plots similar to your image, I placed your plot at the background of this plot, added a temporary fine grid, and chose coordinates that match the image. I could use more points to get it closer to the original, but that doesn't really matter for the explanation. At the end I removed the original image and the grid and added custom labels.

Stefan
LaTeX.org admin
luchito_92
Posts: 3
Joined: Mon Oct 10, 2016 7:01 am

How can I plot ionization graphs in TikZ

Post by luchito_92 »

Hi Stefan Kottwitz, unfortunately i have not formula. That making it difficult u.u
Ty for code, i hope improvement it. Very ty for help me.
mas
Posts: 226
Joined: Thu Dec 04, 2008 4:39 am

How can I plot ionization graphs in TikZ

Post by mas »

To "reproduce" the graphs for which one has neither the formula nor the data, you can use a digitizer to generate the data and plot it using either gnuplot or pgfplots.

Frequently I use engauge-digitizer to get the job done. It is what I use on my Debian GNU/Linux system.

OS: Debian/GNU Linux; LaTeX System : TeXLive; Editor : Vim
User avatar
Stefan Kottwitz
Site Admin
Posts: 10315
Joined: Mon Mar 10, 2008 9:44 pm

How can I plot ionization graphs in TikZ

Post by Stefan Kottwitz »

Hi mas,

Thank you for that recommendation! I tested the engauge digitizer on my Mac, it works fine. I could reproduce a curve with the digitizer and pgfplots.

Stefan
LaTeX.org admin
luchito_92
Posts: 3
Joined: Mon Oct 10, 2016 7:01 am

How can I plot ionization graphs in TikZ

Post by luchito_92 »

Hi mas, test engauge-digitizer and i did not go well. At th end i did with WebPlotDigitizer and i stay so:

i did some step additionals in the code latex.

Image

WebPlotDigitizer:

http://arohatgi.info/WebPlotDigitizer/app/
Post Reply