pgfplots: How to add time axis as second x-axis?plotting two time series with boundsGrouped bar chartHow to define the default vertical distance between nodes?How do i get the x axis on top but keep a line on the bottomHow to prevent rounded and duplicated tick labels in pgfplots with fixed precision?How to hide empty (value 0) ybars with pgfplots?Show mark labels near marks and not centered in ybar interaval graphReading xticklabels from a csvpgfplots: percentage in matrix plotCenter the axes in the coordinate origin
Sigmoid with a slope but no asymptotes?
Should I warn a new PhD Student?
Should a narrator ever describe things based on a character's view instead of facts?
How to make money from a browser who sees 5 seconds into the future of any web page?
Do you waste sorcery points if you try to apply metamagic to a spell from a scroll but fail to cast it?
Can I say "fingers" when referring to toes?
Do I have to know the General Relativity theory to understand the concept of inertial frame?
Identifying "long and narrow" polygons in with Postgis
What is the meaning of "You've never met a graph you didn't like?"
Given this phrasing in the lease, when should I pay my rent?
Proving an identity involving cross products and coplanar vectors
What's the name of the logical fallacy where a debater extends a statement far beyond the original statement to make it true?
How would a solely written language work mechanically
Purpose of creating non root user
Why didn’t Eve recognize the little cockroach as a living organism?
Weird lines in Microsoft Word
Do people actually use the word "kaputt" in conversation?
Storage of electrolytic capacitors - how long?
Quoting Keynes in a lecture
How do you justify more code being written by following clean code practices?
Make a border of symbols in Gimp
Typing CO_2 easily
Air travel with refrigerated insulin
Why does a 97 / 92 key piano exist by Bösendorfer?
pgfplots: How to add time axis as second x-axis?
plotting two time series with boundsGrouped bar chartHow to define the default vertical distance between nodes?How do i get the x axis on top but keep a line on the bottomHow to prevent rounded and duplicated tick labels in pgfplots with fixed precision?How to hide empty (value 0) ybars with pgfplots?Show mark labels near marks and not centered in ybar interaval graphReading xticklabels from a csvpgfplots: percentage in matrix plotCenter the axes in the coordinate origin
I preprocessed a series of data into a time column and a further column with time distance to zero, the latter as decimal value.
Minimum Working Example (MWE):
documentclass[border=5mm]standalone
usepackagepgfplots
pgfplotssetcompat=newest
beginfilecontentsdata.csv
Date;Time;Time_numeric;Temp_1;Temp_2
16.03.2019;18:48:24;0;30;69
16.03.2019;18:48:54;0.008;31;68
16.03.2019;18:49:24;0.017;32;67
16.03.2019;18:49:54;0.025;33;66
16.03.2019;18:50:24;0.033;34;65
16.03.2019;18:50:54;0.042;35;64
16.03.2019;18:51:24;0.05;36;63
16.03.2019;18:51:54;0.058;37;62
16.03.2019;18:52:24;0.067;38;61
16.03.2019;18:52:54;0.075;39;60
16.03.2019;18:53:24;0.083;40;59
16.03.2019;18:53:54;0.092;41;58
16.03.2019;18:54:24;0.1;42;57
16.03.2019;18:54:54;0.108;43;56
16.03.2019;18:55:24;0.117;44;55
16.03.2019;18:55:54;0.125;45;54
16.03.2019;18:56:24;0.133;46;53
16.03.2019;18:56:54;0.142;47;52
16.03.2019;18:57:24;0.15;48;51
16.03.2019;18:57:54;0.158;49;50
endfilecontents
begindocument
begintikzpicture
beginaxis[axis y line* = left,
table/col sep = semicolon]%
addplot table[x=Time_numeric,y=Temp_1]data.csv;
endaxis%
%
beginaxis[axis x line = none,
axis y line* = right,
table/col sep = semicolon]%
addplot table[x=Time_numeric,y=Temp_2]data.csv;
endaxis%
endtikzpicture
enddocument
Screenshot of the result:

Question:
How can I display the time column as a second x-axis above the diagram? As you can imagine, the "real" time column and the column "time distance to zero" should match their lines.
- The top x-axis should display the real time in format 18:48:24
- The bottom x-axis should display the numeric value like seen above
Screenshot of the desired state:

tikz-pgf pgfplots datetime axis abscissa
add a comment |
I preprocessed a series of data into a time column and a further column with time distance to zero, the latter as decimal value.
Minimum Working Example (MWE):
documentclass[border=5mm]standalone
usepackagepgfplots
pgfplotssetcompat=newest
beginfilecontentsdata.csv
Date;Time;Time_numeric;Temp_1;Temp_2
16.03.2019;18:48:24;0;30;69
16.03.2019;18:48:54;0.008;31;68
16.03.2019;18:49:24;0.017;32;67
16.03.2019;18:49:54;0.025;33;66
16.03.2019;18:50:24;0.033;34;65
16.03.2019;18:50:54;0.042;35;64
16.03.2019;18:51:24;0.05;36;63
16.03.2019;18:51:54;0.058;37;62
16.03.2019;18:52:24;0.067;38;61
16.03.2019;18:52:54;0.075;39;60
16.03.2019;18:53:24;0.083;40;59
16.03.2019;18:53:54;0.092;41;58
16.03.2019;18:54:24;0.1;42;57
16.03.2019;18:54:54;0.108;43;56
16.03.2019;18:55:24;0.117;44;55
16.03.2019;18:55:54;0.125;45;54
16.03.2019;18:56:24;0.133;46;53
16.03.2019;18:56:54;0.142;47;52
16.03.2019;18:57:24;0.15;48;51
16.03.2019;18:57:54;0.158;49;50
endfilecontents
begindocument
begintikzpicture
beginaxis[axis y line* = left,
table/col sep = semicolon]%
addplot table[x=Time_numeric,y=Temp_1]data.csv;
endaxis%
%
beginaxis[axis x line = none,
axis y line* = right,
table/col sep = semicolon]%
addplot table[x=Time_numeric,y=Temp_2]data.csv;
endaxis%
endtikzpicture
enddocument
Screenshot of the result:

Question:
How can I display the time column as a second x-axis above the diagram? As you can imagine, the "real" time column and the column "time distance to zero" should match their lines.
- The top x-axis should display the real time in format 18:48:24
- The bottom x-axis should display the numeric value like seen above
Screenshot of the desired state:

tikz-pgf pgfplots datetime axis abscissa
add a comment |
I preprocessed a series of data into a time column and a further column with time distance to zero, the latter as decimal value.
Minimum Working Example (MWE):
documentclass[border=5mm]standalone
usepackagepgfplots
pgfplotssetcompat=newest
beginfilecontentsdata.csv
Date;Time;Time_numeric;Temp_1;Temp_2
16.03.2019;18:48:24;0;30;69
16.03.2019;18:48:54;0.008;31;68
16.03.2019;18:49:24;0.017;32;67
16.03.2019;18:49:54;0.025;33;66
16.03.2019;18:50:24;0.033;34;65
16.03.2019;18:50:54;0.042;35;64
16.03.2019;18:51:24;0.05;36;63
16.03.2019;18:51:54;0.058;37;62
16.03.2019;18:52:24;0.067;38;61
16.03.2019;18:52:54;0.075;39;60
16.03.2019;18:53:24;0.083;40;59
16.03.2019;18:53:54;0.092;41;58
16.03.2019;18:54:24;0.1;42;57
16.03.2019;18:54:54;0.108;43;56
16.03.2019;18:55:24;0.117;44;55
16.03.2019;18:55:54;0.125;45;54
16.03.2019;18:56:24;0.133;46;53
16.03.2019;18:56:54;0.142;47;52
16.03.2019;18:57:24;0.15;48;51
16.03.2019;18:57:54;0.158;49;50
endfilecontents
begindocument
begintikzpicture
beginaxis[axis y line* = left,
table/col sep = semicolon]%
addplot table[x=Time_numeric,y=Temp_1]data.csv;
endaxis%
%
beginaxis[axis x line = none,
axis y line* = right,
table/col sep = semicolon]%
addplot table[x=Time_numeric,y=Temp_2]data.csv;
endaxis%
endtikzpicture
enddocument
Screenshot of the result:

Question:
How can I display the time column as a second x-axis above the diagram? As you can imagine, the "real" time column and the column "time distance to zero" should match their lines.
- The top x-axis should display the real time in format 18:48:24
- The bottom x-axis should display the numeric value like seen above
Screenshot of the desired state:

tikz-pgf pgfplots datetime axis abscissa
I preprocessed a series of data into a time column and a further column with time distance to zero, the latter as decimal value.
Minimum Working Example (MWE):
documentclass[border=5mm]standalone
usepackagepgfplots
pgfplotssetcompat=newest
beginfilecontentsdata.csv
Date;Time;Time_numeric;Temp_1;Temp_2
16.03.2019;18:48:24;0;30;69
16.03.2019;18:48:54;0.008;31;68
16.03.2019;18:49:24;0.017;32;67
16.03.2019;18:49:54;0.025;33;66
16.03.2019;18:50:24;0.033;34;65
16.03.2019;18:50:54;0.042;35;64
16.03.2019;18:51:24;0.05;36;63
16.03.2019;18:51:54;0.058;37;62
16.03.2019;18:52:24;0.067;38;61
16.03.2019;18:52:54;0.075;39;60
16.03.2019;18:53:24;0.083;40;59
16.03.2019;18:53:54;0.092;41;58
16.03.2019;18:54:24;0.1;42;57
16.03.2019;18:54:54;0.108;43;56
16.03.2019;18:55:24;0.117;44;55
16.03.2019;18:55:54;0.125;45;54
16.03.2019;18:56:24;0.133;46;53
16.03.2019;18:56:54;0.142;47;52
16.03.2019;18:57:24;0.15;48;51
16.03.2019;18:57:54;0.158;49;50
endfilecontents
begindocument
begintikzpicture
beginaxis[axis y line* = left,
table/col sep = semicolon]%
addplot table[x=Time_numeric,y=Temp_1]data.csv;
endaxis%
%
beginaxis[axis x line = none,
axis y line* = right,
table/col sep = semicolon]%
addplot table[x=Time_numeric,y=Temp_2]data.csv;
endaxis%
endtikzpicture
enddocument
Screenshot of the result:

Question:
How can I display the time column as a second x-axis above the diagram? As you can imagine, the "real" time column and the column "time distance to zero" should match their lines.
- The top x-axis should display the real time in format 18:48:24
- The bottom x-axis should display the numeric value like seen above
Screenshot of the desired state:

tikz-pgf pgfplots datetime axis abscissa
tikz-pgf pgfplots datetime axis abscissa
edited 22 mins ago
Dave
asked 28 mins ago
DaveDave
883619
883619
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "85"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f480568%2fpgfplots-how-to-add-time-axis-as-second-x-axis%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f480568%2fpgfplots-how-to-add-time-axis-as-second-x-axis%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown