1

enter image description here

How can I reproduce the top picture?

Here's what I have so far:

\begin{tikzpicture}
    \begin{axis}[xticklabel style={anchor=east,rotate=90},
    date coordinates in=x,
    xticklabel={\day.\month.\year},
    table/col sep = semicolon,
    height = 0.3\paperheight, 
    width = 0.5\paperwidth,
    xmin=2015-10-01,
    xmax=2015-12-31,
    ymin=30,
    ymax=55,
    /pgf/number format/1000 sep={},
    no markers,
    every axis plot/.append style={ultra thick}
]
        \addplot table[x index=0, y index=2, col sep=comma] {oil_prices.csv};
        \addlegendentry{Нефть Brent}
        \addplot table[x index=0, y index=1, col sep=comma] {oil_prices.csv};
        \addlegendentry{Нефть WTI}  
    \end{axis}
\end{tikzpicture}

but it produces the following picture, where the x ticks are wrong.

enter image description here

Arun Debray
  • 7,126
  • 2
  • 30
  • 54
  • 2
    Homework? If so, I've done enough of that for one day, but look in the manual of pgpflots for xtick. (To be even more helpful, section 4.15 Tick Options) – Torbjørn T. May 29 '16 at 17:32

1 Answers1

1
\begin{tikzpicture}
\begin{axis}[xticklabel style={anchor=east,rotate=90},
 date coordinates in=x,
 xticklabel={\day.\month.\year},
 table/col sep = semicolon,

 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%INCLUDED LINES
 xtick=data,
 symbolic x coords={{01.10.2015}, {15.10.2015}, {01.11.2015}, {15.11.2015}, {01.12.2015}, {15.12.2015},  {31.12.2015}},
 extra x ticks={{01.10.2015}, {15.10.2015}, {01.11.2015}, {15.11.2015}, {01.12.2015}, {15.12.2015},  {31.12.2015}},
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 height = 0.3\paperheight, 
 width = 0.5\paperwidth,
 xmin=2015-10-01,
 xmax=2015-12-31,
 ymin=30,
 ymax=55,
 /pgf/number format/1000 sep={},
 no markers,
 every axis plot/.append style={ultra thick}
 ]
 \addplot table[x index=0, y index=2, col sep=comma] {oil_prices.csv};
 \addlegendentry{Нефть Brent}
 \addplot table[x index=0, y index=1, col sep=comma] {oil_prices.csv};
 \addlegendentry{Нефть WTI}  
 \end{axis}
 \end{tikzpicture}
user95439
  • 402