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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T19:04:24+00:00 2026-05-13T19:04:24+00:00

I have a large data set I am plotting in R, and I’d like

  • 0

I have a large data set I am plotting in R, and I’d like to have an axis on each side of the graph show the data in two different scales. So for example, on the left vertical axis I’d like to plot the data directly (e.g. plot(y ~ x) ) and on the right axis, I’d like to have a linear scaling of the left axis. (e.g. plot( y*20 ~ x).

So there would only be one data set displayed, but the axes would show different meanings for those data points.

I’ve tried the following:

plot(x = dataset$x, y = dataset$y)
axis(4, pretty(dataset$y,10) )

This will correctly print a new right axis with the same scale as the default left axis. (essentially useless, but it works) However, if I make this tiny change:

plot(x = dataset$x, y = dataset$y)
axis(4, pretty(10*dataset$y,10) )

Suddenly, it refuses to add my new right axis. I suspect this has something to do with R seeing if the axis matches the data set in some way and rejecting it if not. How can I get R to ignore the data set and just print an arbitrary axis of my choosing?

  • 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-13T19:04:24+00:00Added an answer on May 13, 2026 at 7:04 pm

    R doesn’t seem to be rejecting your axes. What error are you getting? Your command will put ticks way off the graph (since it uses the first axis to position them). What I think you want is the following:

    > plot(x = dataset$x, y = dataset$y)
    > axis(4, at = axTicks(2), label = axTicks(2) * 10)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a large sequence of data-maps and each map needs to be classified
I have a data fine being read in using file() and iterate over each
I have a large amount of nested data formatted in JSON . I would
I'm using Devise in a Rails application, and I can set session data through
We have large sets (10+) of very large files (> 1 GB) that we
In my limited experience of working with MySQL I have seen to large apps
I'm planning to build an application that must allow the user to set up
I have an object model that I use to fill results from a query
I'm quite new to C# and encryption so please have patience with me. I
I just wanted to discuss a topic which I am thinking about. I work

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.