Questions tagged [dateplot]

{dateplot} refers to plots where the input coordinates are given by dates.

Filter by
Sorted by
Tagged with
11
votes
1answer
3k views

Adding several labels (year/month) to a graph in pgfplots

I would like to add several labels to a plot in pgfplots: one label for the month and one for the year, just like in this graph: I tried to use the extra tick label, but I don't know how it is ...
8
votes
2answers
975 views

PGFPLOTS Marginal Histogram with date data

I took Jake's code from Scatterplot with Marginal Histograms and ran into a problem with trying to histogram date data on the x axis. The scatterplot and y axis histogram work well, revealing: The ...
8
votes
1answer
210 views

Making pgfplots parse times (or whatever)

Most likely this is trivial for those with some experience in all these expansion issues, but I have a simple question concerning pgfplots. I want to modify its parsing behavior a bit. (Yes, I am ...
8
votes
1answer
2k views

pgfplots dateplot: automated labels on full hours?

I have some data as a function of time. I plot it using dateplot from the pgfplots package. I would like to have x labels in hours and minutes. For every day, I would like to have an additional DD.MM....
7
votes
2answers
303 views

How to change name of month in dateplot?

I produce the following chart: I urgently need to change the month names to Malay, and since there's no package for it, I need to do it manually. In this case, change May to Mei (Mar = Mac, Aug = ...
7
votes
1answer
2k views

Plotting time series data

I would like to plot quarterly time series with special x-axis features. In particular, I would like to see small ticks indicating when the quarters begin and larger ticks indicating when the years ...
6
votes
1answer
903 views

Graph with date x-axis: How to show non-military time?

Sample code: \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=newest} \pagestyle{empty} \usepgfplotslibrary{dateplot} \begin{document} % requires \usepgfplotslibrary{dateplot} ! \...
6
votes
1answer
1k views

xticks steps using Pgfplots / dateplot

I am using pgfplots to plot the following diagram with monthtly data over 20 years. However, I am not quite satisfied with the labels on the x axis. I'd like to have steps of say 3 years (e.g. 1994, ...
6
votes
1answer
287 views

pgfplots skip hours

For my current project, I need to display a series of percentage changes in a plot. This is the code I have so far \documentclass[a4paper]{article} \usepackage{pgfplots} \pgfplotsset{compat=1.11} \...
6
votes
1answer
988 views

Tick labels in pgfplots data time format

I tried to plot a data set containing seconds and milliseconds with pgfplots. I’ve found a solution for my task here (pgfplots data time format), which I changed a bit. This principally works very ...
5
votes
2answers
223 views

Labels for Every Nth Date in Pgfplots

I want to create a graph with dates on the x-axis. I started with the dateplot library in pgfplots. I want date labels only for every third date, e.g., March 4, March 7, March 10, etc., but I can't ...
5
votes
1answer
665 views

Linear regression with dates on x axis in pgfplots

As in this question, I need to add a linear regression line to a plot which has dates on the x axis, but I get following error: ! Package PGF Math Error: Could not parse input '2017-01-01' as a ...
5
votes
2answers
900 views

How to set pgfplot dateplot increment?

With pgfplot and dateplot, How can I set the date increment on the horizontal axis? This is what I have so far: \documentclass{standalone} \usepackage{tikz} \usepackage{pgfplots} \usepgfplotslibrary{...
5
votes
2answers
7k views

Plotting a function when date coordinates are used (pgfplots)

I want to plot a simple function on a plot where date coordinates are used in x but it seems that pgfplots cannot accept both. Here's a MWE of what I'm trying to achieve: \documentclass{standalone} ...
5
votes
1answer
1k views

Trend line with pgfplots and dateplots

Is there an easy way to avoid the following pretty straightforward error message at compile time: Could not parse input '2010-01-01' as a floating point number, sorry. The unreadable part was near '-...
5
votes
1answer
4k views

Draw a vertical line with filled areas and dateplot

I'like to add an vertical line with some text in a graphic, but i've not found the way. I tried something like \addplot coordinates { (2008-01-01,0) (2008-01-01,130)} node {some text}; but it ...
5
votes
1answer
734 views

Increasing dateplot's resolution to seconds

These three dots should be spread out over a period of 50 seconds, but for some reason they all appear at 13:00:30. \documentclass{minimal} \usepackage{pgfplots} \usepgfplotslibrary{dateplot} \begin{...
5
votes
1answer
3k views

Date plot using pgfplots with odd tick label

How do I make the time label in the following image appear as "10:00" (i.e. 10 o'clock) rather than the unexpected and unwelcome "09:60"? Here's the code that I am using: \documentclass{beamer} \...
5
votes
1answer
2k views

PGFplots: dashed lines

How can I do to draw vertical dashed lines which connect markers of one serie with the respective one of the other serie? X axes for both plot is the same. MWE: \documentclass[]{standalone} \...
5
votes
1answer
975 views

Single year interval on dateplot x axis

I am plotting a time series with weekly resolution. Minimal example: \documentclass{article} \usepackage{tikz} \usepackage{pgfplots} \usepgfplotslibrary{dateplot} \begin{document} \begin{...
4
votes
4answers
1k views

stacking negative value for ybar

I would like my ybars to be stacked the same way positively than negatively. It works for positive values but not for negative ones. On the given example, ThirdCol should be stacked negatively. Any ...
4
votes
3answers
287 views

Latex PGFPLOTS: Set value between ticks

I am trying to plot the outside temperature of a city of an average year. Therefore, I want the values (month of year) to be in between the xtick lines, and not on the line. Can somebody help me with ...
4
votes
1answer
3k views

How to create a date and time plot with TikZ and pgfplots

What I want to achieve is a graph, which shows the working hours per day. Input should be the triple of date, arrival time and leaving time. The x-axis holds the dates and the y-axis shows the working ...
4
votes
1answer
195 views

Why is July Printed Twice on X-Axis?

\documentclass{article} \usepackage{tikz} \usepackage{pgfplots} \usepgfplotslibrary{dateplot} \pgfplotsset{compat=1.11} \begin{document} \begin{tikzpicture} \begin{axis}[ date coordinates in=x, ...
4
votes
1answer
43 views

Problem with time format on x-as not displaying correctly

I've made a 24 hour graphic (with different y-axes). So far so good. But the x-axe is not displaying as I wanted. 1/ the time is not displayed correctly 05:59:00 instead of 06:00:00 2/ the x-axe ...
4
votes
1answer
2k views

Error in TikZ pgfplots with timestamps on axis

I get the following error message when I try to compile the attached code. I tried everything, but can't find the error. Runaway argument? \pgfplots@calender@ZEROSHIFT \relax \ifx \pgfplotstemptime \...
4
votes
1answer
685 views

Pgfplots: restrict to domain when using date coordinates

I would like to restrict the domain of the x axis while using date coordinates. However, the following example (modified from pgfplots manual) will not compile since the domain boundaries for the ...
4
votes
1answer
1k views

How can I make dateplot x-ticks steps to 4 years?

I'm currently trying to create a nice election diagram for Bavaria. This is what I got by now: LaTeX source Complete source with Makefile and data is on Github. Here is the LaTeX-part without csv-...
4
votes
2answers
536 views

pgfplots: put a tick each first day of a month

I have a dateplot and I need to put a tick each first (or n-th) day of a month programmatically. I set up the following mwe which doesn't work: \documentclass{standalone} \usepackage{pgfplots} \...
4
votes
0answers
128 views

pgfplots using Time Series in .txt [duplicate]

I have the following Time Series data Date S 2010-01-11 7260 2010-01-12 7270 2010-01-13 7440 2010-01-14 7430 2010-01-15 7460 2010-01-18 7500 2010-01-19 7580 2010-01-20 7470 Where S is the ...
4
votes
0answers
2k views

using gnuplot to plot data from a file

I am trying to plot some data using pgfplots, but the data are so extensive that the maximum capacity is reached. I get the error: TeX capacity exceeded, sorry [main memory size=3000000]. What can I ...
3
votes
1answer
87 views

Filling space under curve in a plot with date coordinates

How can I fill the space between the curves underneath the lines. The red filling should go to y=120, the green to y=80. And only if the datapoints are over this values. \documentclass{scrartcl} \...
3
votes
1answer
133 views

pgfplots: How to add names of the days of the week to dateplot?

Assumed we have the following code: Minimum Working Example (MWE): \documentclass{standalone} \usepackage{pgfplots} \usepackage{filecontents} \usepgfplotslibrary{dateplot} \begin{filecontents}{data....
3
votes
1answer
384 views

pgfplots: How to set xticklabel date year as YY instead of YYYY?

By default, xticklabel = \month/\year, will be displayed as 04/2019. However, I want to display it as 04/19 instead of 04/2019. Minimum Working Example (MWE): \documentclass{standalone} \usepackage{...
3
votes
1answer
588 views

pgfplots, dateplot: how to obtain xtick at given dates?

the following mwe: \documentclass[margin=3mm]{standalone} \usepackage{pgfplots} \usepgfplotslibrary{dateplot} \pgfplotsset{compat=1.15} \usepackage{filecontents} \begin{filecontents*}{data.csv} ...
3
votes
1answer
185 views

add extra label to pgfplot picture

I want to add the beginning and end label as extra label to a pgfplot. example as below: \documentclass[border=2mm]{standalone} \usepackage{pgfplots} \usepgfplotslibrary{dateplot} \begin{document} \...
3
votes
1answer
377 views

Specify custom ticks in dateplot

How to correctly specify ticks in date plots? I tried \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.13} \usepgfplotslibrary{dateplot} \begin{document} %\begin{tikzpicture} %\...
3
votes
1answer
155 views

Incorrect pgfplot dateplot - shifted by a day

Using dateplot the data is horizontally shifted by a day I and cannot see the reason why. This is my MWE: \documentclass{standalone} \usepackage{tikz} \usepackage{pgfplots} \usepgfplotslibrary{...
3
votes
1answer
133 views

Problem to plot data with dates using an external file

Using logs to make statistics, I have a large number of data which contains two columns, like this (dd-mm-aaaa hh-mm float) 27-04-2018 04:43 7.78269552 27-04-2018 04:44 7.901522832 27-04-2018 ...
3
votes
1answer
2k views

pgfplot dateplot discrete dates on axis

With pgfplot using dateplot when plotting data over a small date range, some dates are shown multiple times to "fill" the horizontal axis. I wonder if it is possible to show only discrete dates. Since ...
3
votes
1answer
3k views

pgfplots: Fixing overlapping X axis labels

I am trying to create a time series plot but my X axis labels overlap: \documentclass{article} \usepackage{pgfplots} \pgfplotsset{width=14cm,compat=newest} \usepgfplotslibrary{dateplot} \...
3
votes
0answers
60 views

Colormaps within group plots with date coordinates in pgfplots

I am having issues when using colormaps within group plots that have date coordinates in x. \documentclass[tikz]{standalone} \usepackage{pgfplots} \usepgfplotslibrary{groupplots} \usepgfplotslibrary{...
3
votes
0answers
255 views

Pgfplots: Draw time-series without missing data

I have time-series data which I want to draw with pgfplots. The data only covers weekdays, thus no weekends. Still pgfplots inserts new ticks for datapoints having essentially no data, this results in ...
2
votes
1answer
836 views

pgfplots: How to set xticklabel as two line?

I want to design xticklabels as two line texts: First line: Date, e.g. \month/\day Second line: Time, e.g. \hour:\minute Minimum Working Example (MWE): \documentclass{standalone} \usepackage{...
2
votes
1answer
140 views

PGFplot is not accepting date time file as input

I tried to read a file with time and date on x axis but it gives an error as "could not parse input "00:00:19" as floating point number" I saved the excel file with "tab delimited" extension. I also ...
2
votes
1answer
52 views

Filled area behind bar plot from table data

I have the following MWE where I want to place the data from file myintervals.csv as filled area behind my bar plot. There is a problem with expandable macro here, but I don't get it working correctly:...
2
votes
1answer
274 views

Overlap and non-functioning filling in groupplots

I'm trying to place multiple plots in the same figure. In each plot I'd like to have a certain region highlighted. However, there is significant overlap between the plots and the highlighting doesn't ...
2
votes
1answer
83 views

pgfplots: Change names of weekdays to German language?

The user Torbjørn T. has posted a nice approach on how to display the names of the days of the week in dateplots. Minimum Working Example (MWE): \documentclass{standalone} \usepackage{pgfplots} \...
2
votes
1answer
767 views

Problem with legend on a 2 y-axis line & ybar figure

I cannot seem to figure out a way to switch the legend symbol to the ybar symbol in a two y-axis plot. Here is a minimal working example of my problem Which yields this: So the only problem with the ...
2
votes
1answer
1k views

datetime plot in pgfplot using gnuplot

I have a large data file with several columns wherein the first column is a date and time in the format, 'yyyy-mm-dd hh:MM' and the rest are numerical values of different variables. I often have ...