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 6323141
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T16:27:46+00:00 2026-05-24T16:27:46+00:00

I have data that looks like this: > head(data) date price volume 1 2011-06-26

  • 0

I have data that looks like this:

> head(data)
                 date    price volume
1 2011-06-26 17:16:05 17.51001  2.000
2 2011-06-26 20:50:00 14.80351  2.981
3 2011-06-26 20:51:00 14.90000  2.000
4 2011-06-26 20:52:00 14.89001  0.790
5 2011-06-26 20:53:00 15.00000  1.000
6 2011-06-26 21:05:01 16.20000  6.500
> str(head(data))
'data.frame':   6 obs. of  3 variables:
 $ date  : POSIXct, format: "2011-06-26 17:16:05" "2011-06-26 20:50:00" "2011-06-26 20:51:00" "2011-06-26 20:52:00" ...
 $ price : num  17.5 14.8 14.9 14.9 15 ...
 $ volume: num  2 2.98 2 0.79 1 ...

When I plot it like this:

someColors <- colorRampPalette(c("black", "blue", "orange", "red"), space="Lab")
smoothScatter(data, colramp=someColors)

I get almost exactly what I’m looking for, but it converts the posix dates to numbers. How can I set the x labels more usefully so that my stuff is a bit more readable?

https://img.skitch.com/20110812-nmsrtdbtaey3yqa29g8xkc17tn.png
(source: skitch.com)

Edit: I can get an approximation of what I want like this:

smoothScatter(data, colramp=someColors, xaxt="n")
axis(1, at=data$date,
     labels=lapply(data$date, function(d) strftime(d, "%F")),
     tick=FALSE)

That’s terribly slow, though. It seems like I should be able to prep the data or advice the label drawer a bit.

  • 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-05-24T16:27:47+00:00Added an answer on May 24, 2026 at 4:27 pm

    In terms of speed, it might help to specify range of dates to use for the x-axis labels. For example:

    days <- seq(min(data$date), max(data$date), by = 'month')
    axis(1, at=days,
         labels=strftime(days, "%F"),
         tick=FALSE)
    

    It might also help to round the times to the nearest day:

    days <- seq(as.Date(min(data$date)), as.Date(max(data$date)), by = 'month')
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a data set that looks like this: 000 100 200 300 010
I have a data.frame that looks like this > head(df) Memory Memory Memory Memory
I have a semi-melted data frame that looks like this: head(final_melt) Group Source variable
I have a zoo with daily data that looks like this: > head(almorol) 1973-10-02
I have a data.frame named pp that looks like this: > head(pp) X02R X03N
I have data that looks like this: entities id name 1 Apple 2 Orange
I have data that looks like this: #info #info2 1:SRX004541 Submitter: UT-MGS, UT-MGS Study:
I have SQL data that looks like this: events id name capacity 1 Cooking
I have a data that looks like this . And I intend to create
I have a data that looks like this . And my code below simply

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.