Re: [Pgf-users] dimension problems with plot from external file

 Re: [Pgf-users] dimension problems with plot from external file From: izahn - 2007-07-21 17:52:49  Alain Matthes-2 wrote: >=20 > Le samedi 21 juillet 2007 =C3=A0 08:04 -0700, izahn a =C3=A9crit : >=20 >> \draw[->,xshift=3D-6cm] (6,0) -- (6,17000) coordinate (y axis);=20 >=20 > 17000 is too large. all calculations must not exceed +- 16383.99999 at > any point ( page 266 manual) because algorithms are based on TeX > dimensions.=20 >=20 > Greetings Alain >=20 > Thanks Alain! Based on your post I scaled the y variable down by a factor > of 1000, and then scaled the axis labels back up by hand, giving >=20 > \begin{tikzpicture}[only marks, y=3D.5cm]=20 > \draw plot[mark=3D*,xshift=3D-6cm] file {data2};=20 > \draw[->,xshift=3D-6cm] (6,0) -- (17,0) coordinate (x axis);=20 > \draw[->,xshift=3D-6cm] (6,0) -- (6,27) coordinate (y axis);=20 > \foreach \x in {6,8,10,12,14,16}=20 > \draw [xshift=3D-6cm](\x cm,1pt) -- (\x cm,-3pt) node[anchor=3Dnorth] {$\= x$};=20 > \foreach \y/\ytext in {0/0,2.5/5000,5/10000,7.5/15000,10/20000,12.5/25000= }=20 > \draw (1pt,\y cm) -- (-3pt,\y cm) node[anchor=3Deast] {$\ytext$}; > \draw (6,-2) node {Education}; > \draw [](-2, 5) node [rotate=3D90]{Income}; > \end{tikzpicture} >=20 > Where data2 is the same as data1 in my original post except that the y > variable is scaled down. Is this the "proper" way to do it? >=20 > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > pgf-users mailing list > pgf-users@... > https://lists.sourceforge.net/lists/listinfo/pgf-users >=20 >=20 --=20 View this message in context: http://www.nabble.com/dimension-problems-with= -plot-from-external-file-tf4122106.html#a11724405 Sent from the pgf-users mailing list archive at Nabble.com. 

 [Pgf-users] dimension problems with plot from external file From: izahn - 2007-07-21 15:04:19 I'm sorry this is a long post. I am new to tikZ, and relatively new to LaTeX in general, so I am probably doing things in a very stupid way. I want to create a scatter plot defined by 102 pairs of values, read from an external file. I have been working at it for a couple days now, and I am almost there, but there are still a couple things I can't figure out. The values in the external file represent education level and income for 102 people. The education variable ranges from 6.38 to 15.97, and the income variable ranges from 611 to 25879. After much trial and error, I ended up with the following code: \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture}[x=1.0cm, y=0.0005cm, only marks] \draw plot[mark=*,xshift=-6cm] file {Desktop/data1}; \draw[->,xshift=-6cm] (6,0) -- (17.5,0) coordinate (x axis); \draw[->,xshift=-6cm] (6,0) -- (6,17000) coordinate (y axis); \foreach \x in {6,8,10,12,14,16} \draw [xshift=-6cm](\x cm,1pt) -- (\x cm,-3pt) node[anchor=north] {$\x$}; \foreach \y/\ytext in {1.7/5000,3.4/10000,5.1/15000,6.8/20000,8.5/25000} \draw (1pt,\y cm) -- (-3pt,\y cm) node[anchor=east] {$\ytext$}; \draw (6,-2000) node {Education}; \draw [](-2, 8500) node [rotate=90]{Income}; \end{tikzpicture} \end{document} This almost does what I want, but I get "Dimension too large" warnings. I tried using yscale but this did nothing. Also, I cannot get the y-axis to extend far enough "up". Moreover, I had to calculate the location of the axis tickmarks "by hand", and I'm not sure I got it exactly right. More generally, I'm confused by the scaling issues in this code, as things seem to be on different scales, and I'm not sure what they are. For example, in placing the axis labels (Income and Education) I use y-values that seem to correspond to the dimensions of the data itself (i.e., -2, 8500 for the "Income" label, but when I use the foreach statements I'm using some other scale? I arrived at the values in the code above by trial and error, and I really have no idea what I'm doing. I'm sure there must be a better way to do what I want, any help will be greatly appreciated. I've attached the data1 file in case anyone cares to run my code. Thanks http://www.nabble.com/file/p11722997/data1 data1 -- View this message in context: http://www.nabble.com/dimension-problems-with-plot-from-external-file-tf4122106.html#a11722997 Sent from the pgf-users mailing list archive at Nabble.com. 
 Re: [Pgf-users] dimension problems with plot from external file From: Alain Matthes - 2007-07-21 16:34:34 Le samedi 21 juillet 2007 à 08:04 -0700, izahn a écrit : > \draw[->,xshift=-6cm] (6,0) -- (6,17000) coordinate (y axis); 17000 is too large. all calculations must not exceed +- 16383.99999 at any point ( page 266 manual) because algorithms are based on TeX dimensions. Greetings Alain 
 Re: [Pgf-users] dimension problems with plot from external file From: izahn - 2007-07-21 17:52:49  Alain Matthes-2 wrote: >=20 > Le samedi 21 juillet 2007 =C3=A0 08:04 -0700, izahn a =C3=A9crit : >=20 >> \draw[->,xshift=3D-6cm] (6,0) -- (6,17000) coordinate (y axis);=20 >=20 > 17000 is too large. all calculations must not exceed +- 16383.99999 at > any point ( page 266 manual) because algorithms are based on TeX > dimensions.=20 >=20 > Greetings Alain >=20 > Thanks Alain! Based on your post I scaled the y variable down by a factor > of 1000, and then scaled the axis labels back up by hand, giving >=20 > \begin{tikzpicture}[only marks, y=3D.5cm]=20 > \draw plot[mark=3D*,xshift=3D-6cm] file {data2};=20 > \draw[->,xshift=3D-6cm] (6,0) -- (17,0) coordinate (x axis);=20 > \draw[->,xshift=3D-6cm] (6,0) -- (6,27) coordinate (y axis);=20 > \foreach \x in {6,8,10,12,14,16}=20 > \draw [xshift=3D-6cm](\x cm,1pt) -- (\x cm,-3pt) node[anchor=3Dnorth] {$\= x$};=20 > \foreach \y/\ytext in {0/0,2.5/5000,5/10000,7.5/15000,10/20000,12.5/25000= }=20 > \draw (1pt,\y cm) -- (-3pt,\y cm) node[anchor=3Deast] {$\ytext$}; > \draw (6,-2) node {Education}; > \draw [](-2, 5) node [rotate=3D90]{Income}; > \end{tikzpicture} >=20 > Where data2 is the same as data1 in my original post except that the y > variable is scaled down. Is this the "proper" way to do it? >=20 > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > pgf-users mailing list > pgf-users@... > https://lists.sourceforge.net/lists/listinfo/pgf-users >=20 >=20 --=20 View this message in context: http://www.nabble.com/dimension-problems-with= -plot-from-external-file-tf4122106.html#a11724405 Sent from the pgf-users mailing list archive at Nabble.com.