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

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

How can I plot ionization graphs in TikZ

Postby luchito_92 » Mon Feb 06, 2017 6:01 am

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.
Reason: title changed so it better shows the meaning of the post

Tags:

User avatar
Stefan Kottwitz
Site Admin
Posts: 8980
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Mon Feb 06, 2017 11:10 am

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
Site admin

User avatar
Stefan Kottwitz
Site Admin
Posts: 8980
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Mon Feb 06, 2017 7:41 pm

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:

  1. \documentclass[border=5pt]{standalone}
  2. \usepackage{pgfplots}
  3. \pgfplotsset{width = 6cm, compat = newest}
  4. \usepackage{sansmath}
  5. \pgfplotsset{
  6. tick label style = { font=\tiny\sansmath\sffamily},
  7. label style = { font=\small\sansmath\sffamily}
  8. }
  9. \begin{document}
  10. \begin{tikzpicture}
  11. \begin{axis} [
  12. domain = 0:100,
  13. xlabel = Electron energy,
  14. ylabel = Ionization,
  15. axis lines = left,
  16. clip = false,
  17. xmin = 0, xmax = 100,
  18. ymin = 0, ymax = 100,
  19. xtick={32,65},
  20. xticklabels={$10^1$,$10^2$},
  21. ytick={40,80},
  22. yticklabels={$10^1$,$10^2$},
  23. ]
  24. \addplot [smooth, dashed]
  25. coordinates { (5,4) (7,40) (10,60) (14,74) (20,84) (30,90)
  26. (40,90) (50,87) (60,81) (65,76)};
  27. \addplot [smooth]
  28. coordinates { (8,10) (9,44) (12,64) (14,72) (20,82) (30,87)
  29. (40,88) (50,85) (60,79) (65,74)};
  30. \addplot [smooth]
  31. coordinates { (10,5) (9,20) (9.3,40) (12,61) (15,69.5) (20,75) (30,77)
  32. (40,73) (50,66) (60,58) (65,54)};
  33. \end{axis}
  34. \end{tikzpicture}
  35. \end{document}


plot.png
plot.png (16.01 KiB) Viewed 1632 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
Site admin

luchito_92
Posts: 3
Joined: Mon Oct 10, 2016 7:01 am

Postby luchito_92 » Tue Feb 07, 2017 3:52 am

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: 208
Joined: Thu Dec 04, 2008 4:39 am

Postby mas » Tue Feb 07, 2017 3:52 am

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: 8980
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Tue Feb 07, 2017 2:39 pm

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
Site admin

luchito_92
Posts: 3
Joined: Mon Oct 10, 2016 7:01 am

Postby luchito_92 » Thu Feb 09, 2017 12:22 am

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/


Return to “Graphics, Figures & Tables”

Who is online

Users browsing this forum: No registered users and 8 guests