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













0















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:



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:



Screenshot of the desired state










share|improve this question




























    0















    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:



    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:



    Screenshot of the desired state










    share|improve this question


























      0












      0








      0








      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:



      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:



      Screenshot of the desired state










      share|improve this question
















      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:



      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:



      Screenshot of the desired state







      tikz-pgf pgfplots datetime axis abscissa






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 22 mins ago







      Dave

















      asked 28 mins ago









      DaveDave

      883619




      883619




















          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
          );



          );













          draft saved

          draft discarded


















          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















          draft saved

          draft discarded
















































          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.




          draft saved


          draft discarded














          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





















































          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







          Popular posts from this blog

          acmart: Multiple authors: all with same affiliation, one author an additional affiliationHow to Write Names of Multiple Authors with Shared Affiliation in ACM 2017 Template?Multiple authors with different primary affiliation, but same additional affiliationSame affiliation for all authors without extra packagesIOS-Book-Article.cls: one author with multiple affiliationacmart: Shared Author AffiliationMultiple authors with different primary affiliation, but same additional affiliationAuthor affiliation with only 1 authorAdding Multiple Authors with Different Affiliation in LaTeX ArticleLaTeX: Multiple authors stays on same lineHow to Label Multiple Authors with Same DescriptionHow to make two authors use the same affiliationTwo authors with same affiliation on finished front page

          How to write “ä” and other umlauts and accented letters in bibliography?Accents in BibTeXSorting references with special characters alphabeticallyUse ae ligature in bibliographyEastern European nameInverted circumflex in BibTexBibTex, non-ascii initials and nameptr fproblems with accent in LatexHow to add a Ø to my bibliography from Jabref?References without accentsTroubles when trying to cite St“omer-Verlet in ”title" field of a bib entryComprehensive list of accented charactersHow to type the letter “i” with two dots (diaeresis) in math mode?Problem with glossary text and accented lettersSpecial character in bibliographyAccented letters, Unicode and LaTeX accentsHow to stop natbib from modifying bibliography styleCitation of a paper with non-standard characters by BibtexWrite accented characters to file using writeHow to group the bibliography alphabetically, if some surnames start with “accented” characters?How can I automatically capitalize significant words in my bibliography?

          Problem using RevTeX4-1 with “! Undefined control sequence. @bibitemShut”