Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7766963
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T15:33:23+00:00 2026-06-01T15:33:23+00:00

In the following example I have two years worth of data denoted by data_2007

  • 0

In the following example I have two years worth of data denoted by data_2007 and data_2008 which have a corresponding array of dates:

clear all
DateTime_2007 = datestr(datenum('2007-01-01 00:00','yyyy-mm-dd HH:MM'):1/24:...
    datenum('2007-12-31 23:57','yyyy-mm-dd HH:MM'),...
    'yyyy-mm-dd HH:MM');
DateTime_2007 = cellstr(DateTime_2007);

DateTime_2008 = datestr(datenum('2008-01-01 00:00','yyyy-mm-dd HH:MM'):1/24:...
    datenum('2008-12-31 23:57','yyyy-mm-dd HH:MM'),...
    'yyyy-mm-dd HH:MM');
DateTime_2008 = cellstr(DateTime_2008);

data_2007 =  1 + (20-1).*rand(8760,1);
data_2008 = 1 + (20-1).*rand(8784,1);

I would like to plot the data on one graph, showing how the data has varied over the 2 years, so basically a plot extending over 2 years. How can this be achieved, considering that I need the dates to be shown along the xaxis, and possible only the month name (mmm) to be given (not yyyy-mm-dd HH:MM).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T15:33:24+00:00Added an answer on June 1, 2026 at 3:33 pm

    Have you tried the datetick command to label the axes?

    plot(datenum(DateTime_2007),data_2007)
    hold on
    plot(datenum(DateTime_2008),data_2008,'g')
    datetick('x','mmm')
    

    It might be easier if you didn’t convert your dates to date strings, and then have to convert them back for plotting.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider the following example. I have an interface MyInterface, and then two abstract classes
For example suppose I have the following two functions function a(param1) { console.log(param1); }
Say for example, I have the following two tables: TableA { _id } TableB
For example, let's say I have the following two tables: Table1: Id ---- 1
I have a database which contains two dates which I am concerned with. StartDate
I'll try to clarify by using the following example. In here I have two
I have two tables, as per following example, in an MSSQL db. PROJECT id
I have two questions for the following example: function doIt(){ this.attribute = someValue; //
SHORT DESCRIPTION: For example we have two pages. The second page contain block which
I'm trying to figure out how XSLT process namespace prefixes and have following example:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.