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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T17:07:29+00:00 2026-06-06T17:07:29+00:00

I am trying to plot some test data (show at the end of this

  • 0

I am trying to plot some test data (show at the end of this post), using ggplot using the following command:

options(scipen=20)    
ggplot(testData,aes(x=Group.1, y=x), format(scientific=FALSE)) + 
scale_x_discrete(name="Test", formatter=comma) + geom_bar()

The plot generates well enough, but the x-axis is in scientific notation (as in the test data), how would i go about displaying it at decimal instead?
(As shown in the command i already tried the scipen option and various formatter options – as suggested in other posts on this site)

My test data:

> str(testData)
'data.frame':   5 obs. of  2 variables:
$ Group.1: Factor w/ 5 levels "(1.3e+03,1.5e+03]",..: 1 2 3 4 5
$ x      : num  80000 94000 86000 112000 98000

> testData
            Group.1      x
1 (1.3e+03,1.5e+03]  80000
2 (1.5e+03,1.7e+03]  94000
3 (1.7e+03,1.9e+03]  86000
4 (1.9e+03,2.1e+03] 112000
5 (2.1e+03,2.3e+03]  98000

> dput(testData)
structure(list(Group.1 = structure(1:5, .Label = c("(1.3e+03,1.5e+03]", 
"(1.5e+03,1.7e+03]", "(1.7e+03,1.9e+03]", "(1.9e+03,2.1e+03]", 
"(2.1e+03,2.3e+03]"), class = "factor"), x = c(80000, 94000, 
86000, 112000, 98000)), .Names = c("Group.1", "x"), row.names = c(NA, 
-5L), class = "data.frame")

The generation of testData:

testData <- aggregate(as.numeric(as.character(housing7$PRICE)),
                      by=list(cut(as.numeric(as.character(housing7$SIZE)), 
                      breaks=5)), FUN=mean)
  • 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-06T17:07:31+00:00Added an answer on June 6, 2026 at 5:07 pm

    Once the labels of your factor are stored in scientific notation, it isn’t easy to go back to normal notation.

    Since you used cut to create this factor, you can change the number of digits used in the label with the dig.lab argument. For example:

    testData <- aggregate(as.numeric(as.character(housing7$PRICE)),
    by=list(cut(as.numeric(as.character(housing7$SIZE)), breaks=5,dig.lab=6)), FUN=mean)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to plot some data using pylab scatter function. I'm using pylab.scatter(X,
I'm trying to plot some data into a histogram using pyplot.hist as such: hst
So I'm trying to create some graphs using Core Plot, but for the following
I'm using GD to plot some simple charts from array point data.. Trying to
I have the following problem when trying to plot some 3D data in Mathematica.
I'm using jqPlot to plot some points in my webApp, so I'm trying this:
I am trying to plot some one-dimensional data onto a 2-D plot in MATLAB.
I am using matplotlib and I'm finding some problems when trying to plot large
I am trying to create plot some push pins on map using GeoCoordinate as
I'm currently trying to use the core-plot library to graph some data I get

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.