Contour plots with text...
Submitted by Anonymous on Thu, 27/01/2011
I have problems converting figures with contour plots and descriptive text.
Like, when you have this:
[C,h] = contour(in1mesh,in2mesh,UTfMesh,[-5 0 5 [10:10:300]]);
text_handle = clabel(C,h);
Then the matlab2tikz conversion only converts the curves, but not the text. Can you help me with this?
I can post the fig-file if someone wants a concrete example.
Best regards,
Lars
Forums:

not yet implemented
Yeah so, text fields are really not yet implemented in matlab2tikz, meaning that they all will be ignored. I haven't looked into how MATLAB(R) represents those fields, and how they could be represented in pgfplots, so I have really no idea how long it would take to implement this.
Till then I'd recommend just looking in the Pgfplots manual and see how those text items can be added manually. If there's an easy way, post it here! That'd help in getting it into matlab2tikz.
text along an addplot coordinates
Hi,
I could probably manage doing that manually if I knew a way to create text alongside a curve like:
\begin{tikzpicture}
\draw (0,0) .. controls (6,1) and (9,1) ..
node[near start,sloped,above] {near start}
node {midway}
node[very near end,sloped,below] {very near end} (12,0);
\end{tikzpicture}
(code stolen from the PGF manual)
However, the code representing my contour plots from matlab uses another command for the curves, namely:
\addplot [draw=mycolor2] coordinates{ (0.0001,84.623) (4.81786,84.2105) (8.81812,83.9245) (15.0167,83.4811) (26.3159,82.6731) (52.6317,80.6091) (72.0674,78.9474) (78.9475,78.4545) (105.263,76.516) (131.579,74.3412) (139.256,73.6842) (157.895,72.3508) (163.015,71.9541) (169.174,71.4768) (184.211,70.3117) (206.329,68.4211) (210.526,68.1203) (236.842,66.2043) (263.158,64.0564) (273.659,63.1579) (289.474,62.0262) (315.79,60.0114) (317.112,59.8984) (323.215,59.3769) (340.559,57.8948) (342.105,57.784) (368.421,55.8901) (394.737,53.7685) (408.027,52.6316) (421.053,51.6992) (447.368,49.7084) (471.024,47.6977) (477.164,47.2059) (500,45.5733)};
And this "addplot" I cannot find in the PGF manual. The other command, "coordinates", combined with text I cannot find at all. I can find "coodinates" in combination with "mark = x" but that is not really text.
I have manual 2.0. Is there a manual for 2.1?
/Lars
manual
Hej!
You can find the manual for plotting here:
http://www.iro.umontreal.ca/~simardr/pgfplots.pdf
Katherine