8

In the shown image bottom and left lines are considered as axis...:How to consider left curve as an axis in the chart?

Psychrometric charts: http://en.wikipedia.org/wiki/File:PsychrometricChart.SeaLevel.SI.svg

\documentclass{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw[help lines] (0,0) grid (8,6);
%
\coordinate (ns) at (0,1.5);
\draw [thick] (ns)--++(0,-1.5)coordinate (nx)--++(7,0) coordinate (no)--++(0,6)coordinate (ny)--++(-1.5,0) coordinate (ne);
\draw [thick] (ns) to [bend right] (ne);
%
\coordinate (n1) at (5,2);
\fill[red] (n1) circle (2pt);
%axis
\path  (ny) coordinate (yaxis) |- (nx) coordinate (xaxis);
\draw[dashed] (xaxis -| n1) node[below] {$DBT_1$} -- (n1);
\draw[dashed] (yaxis |- n1) node[right] {$W_1$} -- (n1);
\end{tikzpicture}
\end{document}

enter image description here

i want to draw as below: an inclined line upto the curve and write $WBT_1$

enter image description here

1
  • Specifying the tag tikz-pgf is sufficient. As a result, the prefix TikZ: can be removed from the title of your questions. Jun 8, 2012 at 17:16

2 Answers 2

12

This is not exactly what you are asking (the curve isn't an axis), but will give the desired result. I am sure someone will give you a better answer, but in the meantime, here it is:

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{intersections}
\begin{document}
\begin{tikzpicture}
\draw[help lines] (0,0) grid (8,6);
%
\coordinate (ns) at (0,1.5);
\draw [thick] (ns)--++(0,-1.5)coordinate (nx)--++(7,0) coordinate (no)--++(0,6)coordinate (ny)--++(-1.5,0) coordinate (ne);
\draw [thick, name path=curve] (ns) to [bend right] (ne);
%
\coordinate (n1) at (5,2);
\fill[red] (n1) circle (2pt);
%axis
\path  (ny) coordinate (yaxis) |- (nx) coordinate (xaxis);
\draw[dashed] (xaxis -| n1) node[below] {$DBT_1$} -- (n1);
\draw[dashed] (yaxis |- n1) node[right] {$W_1$} -- (n1);
%
\draw[name path=line,color=white,opacity=0] (n1) -- (3,4);
\draw[dashed,name intersections={of={line and curve}}] (n1) -- (intersection-1) node[above left]{$WBT_1$};
\end{tikzpicture}
\end{document}

enter image description here

3
  • Good answer. An interesting question is to find a point to get a line perpendicular to a tangent line at the curve Jun 8, 2012 at 11:36
  • @Altermundus yes, I think you can do that, but I imagined if someone knew how to do it, it would be you!
    – Vivi
    Jun 8, 2012 at 14:15
  • @Altermundus: There's been a question about drawing tangent lines and their orthogonals for arbitrary curves: tex.stackexchange.com/a/25940/2552.
    – Jake
    Jun 8, 2012 at 16:40
4

If you just need to mark some points on your curve, you can decorate it. Next code is your example with a decoration adapted from an example in pgf's manual.

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{decorations.markings}
\begin{document}
\begin{tikzpicture}[decoration={markings,
mark=between positions 0 and 1 step 0.1 with {
\node [circle,fill,inner sep=1pt,
name=mark-\pgfkeysvalueof{/pgf/decoration/mark info/sequence number},
transform shape]
{};}}]
%\draw[help lines] (0,0) grid (8,6);
%
%\coordinate (ns) at (0,1.5);
\draw [thick] (0,1.5) coordinate (ns)--++(0,-1.5)coordinate (nx)--++(7,0) coordinate (no)--++(0,6)coordinate (ny)--++(-1.5,0) coordinate (ne);
\draw[thick,postaction={decorate}] (ns) to [bend right] (ne) node[circle,fill,inner sep=1pt](mark-11){};
%
%\coordinate (n1) at (5,2);
\fill[red] (5,2) coordinate (n1) circle (2pt);
%axis
%\draw path  (ny) coordinate (yaxis) |- (nx) coordinate (xaxis);
\draw[dashed] (n1) -- (nx -| n1) node[below] {$DBT_1$};
\draw[dashed] (n1) -- (ny |- n1) node[right] {$W_1$};
\draw[dashed] (n1) -- (mark-3);
\draw[dashed] (n1) -- (mark-5);
\draw[dashed] (n1) -- (mark-8);
\end{tikzpicture}
\end{document}

enter image description here

Edit

Next code is a little improvement (I hope so!). I've defined a mymark style which can be used several times over the same path. It uses two arguments, first one is the portion where to place a coordinate node named according to the second argument. This way you can add as many marks (coordinates) you need over the curved axis.

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{decorations.markings}
\begin{document}
\begin{tikzpicture}[%
mymark/.style 2 args={postaction={%
    decorate,
    decoration={%
    markings,
    mark=at position #1 with
    \coordinate (#2) {};}}}]

\draw [thick] (0,1.5) coordinate (ns)--++(0,-1.5)coordinate (nx)--++(7,0) coordinate (no)--++(0,6)coordinate (ny)--++(-1.5,0) coordinate (ne);

\draw[thick,mymark={0.3}{aaa},mymark={0.65}{bbb}] (ns) to [bend right] (ne);
%
\fill[red] (5,2) coordinate (n1) circle (2pt);
%axis
\draw[dashed] (n1) -- (nx -| n1) node[below] {$DBT_1$};
\draw[dashed] (n1) -- (ny |- n1) node[right] {$W_1$};
\draw[dashed] (n1) -- (aaa);
\draw[dashed] (n1) -- (bbb);
\end{tikzpicture}
\end{document}

enter image description here

You must log in to answer this question.

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