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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T01:56:35+00:00 2026-06-06T01:56:35+00:00

I am playing around with d3 to build some scatter plots. For some reason,

  • 0

I am playing around with d3 to build some scatter plots. For some reason, I am not able to get a proper X-axis for my plot – the axis always has some overlapping text. Also, the dots seem to overlap with the axis. How can I fix this to look nicer?

I have put my attempt at jsfiddle. Any suggestions?

  • 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-06T01:56:36+00:00Added an answer on June 6, 2026 at 1:56 am

    You can use axis.ticks to reduce the number of ticks; xAxis.ticks(5) seems to work well here.

    To stop the dots from overlapping the axes, you have a few options. One is that you could increase the tickSize or the tickPadding. The circles would still overlap the tick marks, but they wouldn’t overlap the tick labels. The other option is that you can increase your domain to force there to be additional space between the circles and the axis.

    Normally, you compute the domain automatically with d3.extent (or just d3.min and d3.max). Here’s an example of how to extend the domain by 10% on each side:

    // First set the domain automatically from the data.
    var x = d3.scale.linear().domain(d3.extent(numbers));
    
    // Then extend the domain using invert (with the default range [0, 1]).
    x.domain([-.1, 1.1].map(x.invert));
    
    // Lastly set the desired range.
    x.range([0, width]);
    

    In your case, since you’re hard-coding the domain, you can just change what you’re hard-coding to a wider range of values.

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

Sidebar

Related Questions

I'm playing around with Node.js as a driver for some build time javascript optimization.
been playing around with ResolveClientUrl(~/Confirmation.aspx) and other methods.. I am tryin go get the
I have been playing around with Scala parser combinators for some time now, and
I been playing around with some custom html helpers and I now I am
So I was playing around with some code and wanted to see which method
I'm playing around with Ruby to do some file versioning for me. I have
This is my first time playing around with SignalR. I am trying to build
I'm playing around, trying to write some code to use the tr.im APIs to
I've been playing around with using Paperclip to build a photo gallery/store. A Gallery
I am playing around with jQuery and thought I would build a little css

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.