Seite 1 von 1

Graph aus R nach Latex

Verfasst: Di 29. Dez 2020, 18:40
von student_94

Hallo,

kann mir jemand sagen,

wie ich bei diesem Code

\begin{center}
\begin{figure}[h]
\begin{tikzpicture}[x=1pt,y=1pt]

\definecolor{fillColor}{RGB}{27,27,27}
\path[use as bounding box,fill=fillColor,fill opacity=0.00] (0,0) rectangle (325.21,325.21);
\begin{scope}
\path[clip] ( 49.20, 61.20) rectangle (300.01,276.01);
\definecolor{drawColor}{RGB}{0,0,0}

\path[draw=drawColor,line width= 0.4pt,line join=round,line cap=round] ( 58.49, 69.16) --
( 59.27, 69.18) --
( 60.06, 69.22) --
( 60.85, 69.31) --
( 61.65, 69.36) --
( 62.43, 69.43) --
( 63.22, 69.49) --
( 64.02, 69.50) --
( 64.81, 69.45) --
( 65.59, 69.42) --
( 66.38, 69.43) --
( 67.18, 69.41) --
( 67.97, 69.50) --
( 68.75, 69.59) --
( 69.54, 69.76) --
( 70.33, 69.87) --
( 71.13, 70.01) --
( 71.91, 70.09) --
( 72.69, 70.16) --
( 73.49, 70.20) --
( 74.29, 70.24) --
( 75.07, 70.25) --
( 75.86, 70.31) --
( 76.66, 70.43) --
( 77.45, 70.50) --
( 78.23, 70.53) --
( 79.02, 70.53) --
( 79.81, 70.48) --
( 80.61, 70.47) --
( 81.39, 70.48) --
( 82.18, 70.52) --
( 82.97, 70.60) --
( 83.77, 70.73) --
( 84.55, 70.81) --
( 85.33, 70.89) --
( 86.13, 70.95) --
( 86.93, 70.97) --
( 87.71, 71.03) --
( 88.50, 71.08) --
( 89.30, 71.17) --
( 90.09, 71.25) --
( 90.87, 71.27) --
( 91.66, 71.34) --
( 92.45, 71.30) --
( 93.25, 71.23) --
( 94.03, 71.27) --
( 94.81, 71.40) --
( 95.61, 71.53) --
( 96.41, 71.63) --
( 97.19, 71.74) --
( 97.97, 71.76) --
( 98.77, 71.80) --
( 99.56, 71.93) --
(100.35, 71.91) --
(101.14, 71.95) --
(101.93, 71.90) --
(102.73, 71.95) --
(103.51, 72.05) --
(104.30, 72.16) --
(105.09, 72.28) --
(105.89, 72.40) --
(106.67, 72.46) --
(107.45, 72.54) --
(108.25, 72.57) --
(109.05, 72.66) --
(109.82, 72.73) --
(110.61, 72.87) --
(111.41, 72.96) --
(112.20, 73.10) --
(112.99, 73.18) --
(113.78, 73.31) --
(114.57, 73.36) --
(115.37, 73.55) --
(116.15, 73.66) --
(116.94, 73.84) --
(117.73, 74.05) --
(118.53, 74.27) --
(119.31, 74.35) --
(120.09, 74.49) --
(120.89, 74.61) --
(121.69, 74.72) --
(122.46, 74.76) --
(123.25, 74.91) --
(124.05, 75.06) --
(124.84, 75.32) --
(125.63, 75.55) --
(126.42, 75.70) --
(127.21, 75.86) --
(128.01, 76.09) --
(128.79, 76.24) --
(129.57, 76.43) --
(130.37, 76.51) --
(131.17, 76.63) --
(131.95, 76.78) --
(132.73, 76.95) --
(133.53, 76.98) --
(134.32, 77.41) --
(135.10, 77.60) --
(135.89, 77.80) --
(136.69, 77.92) --
(137.48, 78.29) --
(138.27, 78.62) --
(139.06, 78.84) --
(139.85, 79.20) --
(140.65, 79.65) --
(141.43, 79.98) --
(142.21, 80.17) --
(143.01, 80.56) --
(143.81, 80.70) --
(144.58, 81.06) --
(145.37, 81.34) --
(146.17, 81.70) --
(146.96, 81.86) --
(147.74, 82.19) --
(148.53, 82.72) --
(149.32, 83.20) --
(150.12, 83.75) --
(150.91, 84.04) --
(151.70, 84.36) --
(152.49, 84.80) --
(153.29, 85.30) --
(154.07, 85.92) --
(154.85, 86.50) --
(155.65, 86.93) --
(156.44, 87.28) --
(157.22, 88.47) --
(158.01, 89.06) --
(158.81, 89.82) --
(159.60, 90.28) --
(160.38, 90.87) --
(161.17, 91.58) --
(161.96, 92.10) --
(162.76, 92.71) --
(163.55, 92.78) --
(164.33, 93.33) --
(165.13, 94.52) --
(165.93, 95.80) --
(166.70, 96.16) --
(167.49, 97.07) --
(168.29, 97.25) --
(169.08, 97.19) --
(169.86, 97.73) --
(170.65, 98.04) --
(171.45, 98.38) --
(172.24, 99.03) --
(173.02,100.01) --
(173.81,101.03) --
(174.60,102.01) --
(175.40,103.05) --
(176.19,103.99) --
(176.97,104.68) --
(177.77,105.28) --
(178.57,106.03) --
(179.34,106.63) --
(180.13,107.48) --
(180.93,108.01) --
(181.72,108.60) --
(182.50,108.95) --
(183.29,109.53) --
(184.08,109.99) --
(184.88,110.58) --
(185.66,111.36) --
(186.45,112.09) --
(187.24,113.23) --
(188.04,113.83) --
(188.83,114.91) --
(189.61,115.77) --
(190.41,116.85) --
(191.20,117.88) --
(191.98,118.82) --
(192.77,119.59) --
(193.57,120.07) --
(194.36,121.23) --
(195.14,122.03) --
(195.93,122.54) --
(196.72,122.45) --
(197.52,122.73) --
(198.30,123.58) --
(199.09,124.31) --
(199.88,124.85) --
(200.68,125.76) --
(201.46,126.76) --
(202.25,127.64) --
(203.05,128.70) --
(203.84,129.15) --
(204.62,129.89) --
(205.41,130.56) --
(206.21,131.78) --
(207.00,132.72) --
(207.78,133.94) --
(208.57,134.72) --
(209.36,135.86) --
(210.16,136.48) --
(210.94,137.03) --
(211.72,137.97) --
(212.52,138.80) --
(213.32,139.69) --
(214.10,141.21) --
(214.89,142.12) --
(215.69,143.31) --
(216.48,144.26) --
(217.26,145.70) --
(218.05,147.03) --
(218.84,147.99) --
(219.64,148.92) --
(220.42,149.87) --
(221.21,151.27) --
(222.00,152.87) --
(222.80,154.01) --
(223.58,155.00) --
(224.36,156.46) --
(225.16,158.47) --
(225.96,159.43) --
(226.74,161.69) --
(227.53,162.36) --
(228.33,163.46) --
(229.12,163.78) --
(229.90,164.93) --
(230.69,164.92) --
(231.48,165.51) --
(232.28,166.70) --
(233.06,167.66) --
(233.85,168.58) --
(234.64,169.31) --
(235.44,170.35) --
(236.22,171.55) --
(237.00,173.90) --
(237.80,175.77) --
(238.59,177.16) --
(239.38,178.91) --
(240.17,180.71) --
(240.97,182.73) --
(241.76,184.94) --
(242.54,186.32) --
(243.33,188.47) --
(244.12,190.22) --
(244.92,192.74) --
(245.70,194.09) --
(246.48,195.17) --
(247.28,196.74) --
(248.08,198.33) --
(248.85,199.94) --
(249.64,201.35) --
(250.44,202.70) --
(251.23,202.42) --
(252.02,203.85) --
(252.81,204.12) --
(253.60,201.58) --
(254.40,200.05) --
(255.18,199.66) --
(255.97,200.29) --
(256.76,202.21) --
(257.56,203.07) --
(258.34,204.97) --
(259.12,206.39) --
(259.92,207.88) --
(260.72,208.29) --
(261.49,210.24) --
(262.28,211.12) --
(263.08,213.02) --
(263.87,215.08) --
(264.66,216.31) --
(265.45,217.28) --
(266.24,218.22) --
(267.04,220.17) --
(267.82,220.80) --
(268.60,222.75) --
(269.40,224.92) --
(270.20,225.12) --
(270.98,228.15) --
(271.76,230.82) --
(272.56,232.01) --
(273.35,233.43) --
(274.13,235.47) --
(274.92,236.61) --
(275.72,236.90) --
(276.51,237.75) --
(277.30,239.47) --
(278.09,240.99) --
(278.88,242.95) --
(279.68,244.84) --
(280.46,246.15) --
(281.24,248.36) --
(282.04,251.32) --
(282.84,254.14) --
(283.61,257.01) --
(284.40,258.77) --
(285.20,260.31) --
(285.99,262.21) --
(286.77,264.20) --
(287.56,266.14) --
(288.36,268.06) --
(289.15,266.34) --
(289.94,247.46) --
(290.73,262.60);
\end{scope}
\begin{scope}
\path[clip] (  0.00,  0.00) rectangle (325.21,325.21);
\definecolor{drawColor}{RGB}{0,0,0}

\path[draw=drawColor,line width= 0.5pt,line join=round,line cap=round] ( 99.56, 61.20) -- (289.15, 61.20);

\path[draw=drawColor,line width= 0.4pt,line join=round,line cap=round] ( 99.56, 61.20) -- ( 99.56, 55.20);

\path[draw=drawColor,line width= 0.4pt,line join=round,line cap=round] (162.76, 61.20) -- (162.76, 55.20);

\path[draw=drawColor,line width= 0.4pt,line join=round,line cap=round] (225.96, 61.20) -- (225.96, 55.20);

\path[draw=drawColor,line width= 0.4pt,line join=round,line cap=round] (289.15, 61.20) -- (289.15, 55.20);
\end{scope}
\end{tikzpicture}
\caption{GDP series for USA}
\end{figure}
\end{center}

Die x-Achse und y-Achse angezeigt und beschritt bekomme. Der Code stammt aus R-Studio.

Vielen Dank!


Re: Graph aus R nach Latex

Verfasst: Mi 30. Dez 2020, 00:21
von Bartman

Das kommt darauf, was Du mit Beschriftung meinst. Wenn außer einer Benennung der Achsen auch noch Werte an den Achsen auszugeben sind, dann wäre das ein Grund, den Einsatz von pgfplots zu erwägen.