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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:15:40+00:00 2026-06-13T09:15:40+00:00

I have the following simple code that attempts to show three graphs in the

  • 0

I have the following simple code that attempts to show three graphs in the same plot. The two last graphs I ask for with the “lines”-function won’t show and I am at my wits end. Is this a bug or am I doing something stupid?

Workarounds, or ways of doing this not using “lines” also appreciated.

No error messages, but won’t show the lines I ask for (see the r.lines() calls below).

from rpy2.robjects import r
from rpy2.robjects.packages import importr
grdevices = importr('grDevices')

d = {0: {0: 5669, 800: 1001, 100: 2240, 200: 1606, 300: 1366, 400: 1236, 500: 1146, 600: 1083, 900: 964, 700: 1037}, 10: {0: 0, 800: 155, 100: 229, 200: 218, 300: 194, 400: 178, 500: 171, 600: 165, 900: 150, 700: 160}, 5: {0: 0, 800: 195, 100: 415, 200: 330, 300: 279, 400: 258, 500: 241, 600: 219, 900: 185, 700: 201}}
x = range(0,1000,100)
y = [d[0][i] for i in x]
z = [d[5][i] for i in x]
ae  = [d[10][i] for i in x]

#grdevices.pdf(file = 'reads_per_slackvalue_and_cluster_size.pdf')

r.plot(x,y, main='Reads per slack value', xlab='slack value',ylab='number of reads', type='l', col='blue')
r.lines(x, z, col='red')
r.lines(x, ae, col='green')

#r.legend("topleft", ['0','5','10'], ['blue','red','green'])

#grdevices.dev_off()

show_image = raw_input()

This is the result:

enter image description here

This is what I get doing the same stuff interactively in R (more correct):

enter image description here

  • 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-13T09:15:41+00:00Added an answer on June 13, 2026 at 9:15 am

    Are you sure about your rpy2 code ? Two hints:

    1. The rpy2-produced plot and the R-plot show rather different curve shapes. May be something to investigate ?

    2. The two lines below added to your code do make a second line. Definitely worth checking that your x and y coordinates are within the plotting area.

    code:

    from rpy2.robjects.vectors import IntVector
    r.lines(x, IntVector(y) - 500, col = "green")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code that fills dataTable1 and dataTable2 with two simple SQL
I have a simple assembly code file called exit.s that looks like the following:
I have the following sample code and noticed that if I attempt to use
I have the following code sample that im trying to wrap my head around
I have the following code that simply moves my image across the screen: /*
I have a following simple code: def get(): return [lambda: i for i in
i have the following simple code, but it doesn,t work <ul> <li id=one onmouseover=this.style.background-color='white';>
I have the following simple code abstract class A { public abstract void Test(Int32
I have the following very simple code snippet which is loaded from a separate
I have the following simple Java code: package testj; import java.util.*; public class Query<T>

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.