Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

We are plotting three functions as follows


\addplot[domain=0:1,blue] {(1-x)/5};

\addplot[domain=0:1,yellow] {0.5/( 2-x)^3 * 1.0 / sqrt(16 + 14 / (2-x)^4 ) };

\addplot[domain=0:1,red] {


enter image description here

Please help us in obtaining

  1. Y-axis has a marker 5 * 10 ^{-2}. We only want 0.05

  2. Draw vertical lines from the intersection point between blue and yellow (also between blue and red curve) onto the axis and label the points on the axis.

  3. Instead of lines we want to use symbols for at least two out of three plots.

  4. What else can be done to make it more appealing.

share|improve this question
Herbert Thank you. –  Mia Dec 28 '12 at 11:53
Thank you Adorable Creature. Now we have a minimum working example. Help us make it better. –  Mia Dec 28 '12 at 13:23
About the (3.): use mark= option for \addplot, for example: \addplot[domain=0:1,yellow,mark=*], where mark can be found in pgfplots manual in the section 4.6.1. Combining with only marks would get rid of smooth line. –  m0nhawk Dec 28 '12 at 13:40
For (2.), tex.stackexchange.com/questions/38461/… (and the one I mentioned before, tex.stackexchange.com/questions/83503). –  Torbjørn T. Dec 29 '12 at 10:17
For (1.) yticklabel style={/pgf/number format/fixed} –  hpesoj626 Dec 31 '12 at 7:50
add comment

1 Answer

up vote 7 down vote accepted

Here is an ugly hack for the answer the unanswered session. I've slightly modified Jake's axis coordinate transformation.

When the marks are introduced, finding intersections would be even more of a hack hence drawing the functions twice might be easier (one for the intersection without drawing, one for the marks). On a personal note, I've tried the only marker curves and intersection in between markers mean nothing visually. Hence you might reconsider that idea. Instead I've color coded the extra nodes to distinguish what is what.

The main difficulty is that the information required is spread out to different layers of TikZ, pgfplots plot, and pgfplots visualization environments. So if anyone else has a better fix I can delete this one.


\pgfmathparse{\pgf@x/\pgfplotsunitxlength +\pgfplots@data@scale@trafo@SHIFT@x)/10^\pgfplots@data@scale@trafo@EXPONENT@x}



yticklabel style={/pgf/number format/fixed},

\addplot[name path global=funone,blue] {(1-x)/5};
\addplot[name path global=funtwo,yellow] {0.5/( 2-x)^3 * 1.0 / sqrt(16 + 14 / (2-x)^4 ) };
\addplot[name path global=funthree,red] {

\path[name intersections={of={funone and funtwo},name=i},
      name intersections={of={funone and funthree},name=in}] (i-1) (in-1);
\path (i-1)  \pgfextra{\markxof{i-1}\xdef\myfirsttick{\pgfmathresult}}
      (in-1) \pgfextra{\markxof{in-1}\xdef\mysecondtick{\pgfmathresult}};


\draw[ultra thin, draw=gray] (i-1 |- {rel axis cs:0,0}) node[fill=yellow,yshift=-5ex] 
{\pgfmathprintnumber[fixed,precision=5]\myfirsttick} -- (i-1);
\draw[ultra thin, draw=gray] (in-1 |- {rel axis cs:0,0}) node[fill=red,yshift=-7.5ex] 
{\pgfmathprintnumber[fixed,precision=5]\mysecondtick} -- (in-1);



enter image description here

share|improve this answer
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.