1

I would like to draw the diagram below using tikz

enter image description here

I started the task with these codes

\documentclass[openany]{book}
\usepackage{tikz}
\usetikzlibrary{patterns}
\usepackage{mhchem}
\begin{document}
\begin{tikzpicture}[>=latex]
\draw[<->](0,4)node[rotate=90,above]{Pressure}|-(4,0)node[below
left]{Volume};
\draw (.3,3.5)node[above]{\textit{l}}to[bend right=5](.4,.7)--(2.6,.7)-- 
(3.6,.3);
\draw (.7,3.5)node[above]{\textit{n}}to[bend right=15](3.6,1); 
\draw (.5,3.5)..controls(.6,1.2)..(2.6,1.2); 
\draw (2.6,1.2)--(3.6,.7)node[right]{\textit{m}}; 
\draw[dashed] (.4,.5)node[below]{C}..controls(1.5,2)..(3,.3)node[below]{A}; 
\node[left]at (1.8,1.8){X}; 
\end{tikzpicture}
\end{document}

Result from the above

enter image description here

My searches could not return what I need to solve this. Any help on this will be highly appreciated

2
  • 1
    Hello and welcome to TeX-SE. What you already did is nice, you need to dig into the intersections library to find the intersecting points between those curves and adapt your design.
    – SebGlav
    Jul 26, 2021 at 8:42
  • @SebGlav, didn't search patiently and later found the solution herehttps://www.google.com/url?sa=t&source=web&rct=j&url=tex.stackexchange.com/questions/312677/…
    – Kidegalize
    Jul 26, 2021 at 12:19

1 Answer 1

1

Here's a quick step towards your deisred design:

isotherm of a gas

\documentclass[tikz,border=3.14mm]{standalone}

\usetikzlibrary{positioning,intersections,calc}

\begin{document}
    \begin{tikzpicture}[>=latex,font=\footnotesize]
        
        \draw[<->](0,4)node[rotate=90,above left]{Pressure}|-(4,0)node[below
        left]{Volume};
        
        \draw[name path=pres,dashed]    (.4,.2) .. controls ++(.2,1) and ++(-.5,0) ..
                        (1.5,2) node[below]{X} .. controls ++(.5,0) and ++(-1.5,.5) .. 
                        (3.8,.2) ; 
        
        \path[name path=L1] (0,0.6) --++ (4,0);
        \path[name path=L2] (0,1.2) --++ (4,0);
        
        \path[name intersections={of=L1 and pres}];
        \coordinate (C) at (intersection-1);
        \coordinate (B) at (intersection-2);
        
        \path[name intersections={of=L2 and pres}];
        \coordinate (E) at (intersection-1);
        \coordinate (F) at (intersection-2);
            
        
        \def\h{3.5}
        
                
        \draw (.3,\h) node[above]{$l$} to[bend right=3] (C) node[below left] {C} --  (B) node[below] {B} to[bend right=5] (3.8,.4) node[below right] {A};
        \draw (.4,\h) to[bend right=6] (E) --  (F) to[bend right=12]    (3.8,.5);
        
        \draw [blue]    (.5,\h) .. controls ++ (0.1,-1.5) and ++(-.2,0) .. 
                (1.5,2) .. controls ++ (.5,0) and ++ (-1,.2) ..
                (3.8,.6) node[right]{$m$};
        
        \draw   (.6,\h) .. controls ++ (0.1,-1) and ++(-.3,0.1) .. 
                (1.5,2.1) .. controls ++ (.7,-.15) and ++ (-.9,.2) ..
                (3.8,.7);
        
        \draw (.8,3.5)node[above]{\textit{n}}to[bend right=17](3.8,1); 
        
    \end{tikzpicture}
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .