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

  • Home
  • SEARCH
  • 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 8815047
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T04:16:41+00:00 2026-06-14T04:16:41+00:00

Can you help me on putting labels on the following graph? The code i

  • 0

Can you help me on putting labels on the following graph?

http://img849.imageshack.us/img849/7594/snap1034.png

The code i use is:

valbanks<-scan("banks.txt", what=list(0,0,""), sep="", skip=1, comment.char="#")
valbanks

valj2007<-valbanks[[1]]
valj2009<-valbanks[[2]]
namebank<-valbanks[[3]]

percent_losses<-(valj2009-valj2007)/valj2007
percent_losses

abs_losses<-(valj2007-valj2009)
abs_losses

plot(abs_losses, percent_losses,main="Absolute Losses vs. Relative Losses(in%)",xlab="Losses (absolute, in miles of millions)",ylab="Losses relative (in % of January´2007 value",col="blue", pch = 19, cex = 1, lty = "solid", lwd = 2,text(percet_losses, abs_losses,namebank))

text(percet_losses, abs_losses,labels=namebank, cex= 0.7, offset = 10)

and the data is:

Value_Jan_2007  Value_Jan_2009  Bank    #
49  16  Morgan_Stanley
120 4.6 RBS
76  10.3    Deutsche_Bank
67  17  Credit_Agricole
80  26  Societé_Generale
91  7.4 Barclays
108 32.5    BNP-Paribas
93  26  Unicredit
116 35  UBS
75 27   Credit_Suise
100 35  Goldman_Sachs
116 64  Santander
255 19  Citigroup
165 85  JP_Morgan
215 97  HSBC

Thank you very much

What is the option to put the label at the bottom, right, up, left,… ?

Summarizing: I want a graph similar that the one that is in the second message from this post
but there is no the code there.

What code i have to put?


if i put text(percet_losses, abs_losses,namebank), i obtain nothing: the graph continue without changes.

Could you show me the code i need to put?

Thanks

  • 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-14T04:16:42+00:00Added an answer on June 14, 2026 at 4:16 am

    Your call to text() doesn’t output anything because you inverted your x and your y:

    plot(abs_losses, percent_losses, 
         main= "Absolute Losses vs. Relative Losses(in%)",
         xlab= "Losses (absolute, in miles of millions)",
         ylab= "Losses relative (in % of January´2007 value)",
         col= "blue", pch = 19, cex = 1, lty = "solid", lwd = 2)
    
    text(abs_losses, percent_losses, labels=namebank, cex= 0.7)
    

    Now if you want to move your labels down, left, up or right you can add argument pos= with values, respectively, 1, 2, 3 or 4. For instance, to place your labels up:

     text(abs_losses, percent_losses, labels=namebank, cex= 0.7, pos=3)
    

    enter image description here

    You can of course gives a vector of value to pos if you want some of the labels in other directions (for instance for Goldman_Sachs, UBS and Société_Generale since they are overlapping with other labels):

     pos_vector <- rep(3, length(namebank))
     pos_vector[namebank %in% c("Goldman_Sachs", "Societé_Generale", "UBS")] <- 4
     text(abs_losses, percent_losses, labels=namebank, cex= 0.7, pos=pos_vector)
    

    enter image description here

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

Sidebar

Related Questions

Who can help me to fix the following problem? Here is the issue: in
Who can help me make the following query work... Both tables have the fields
Can anyone help me with putting an image or icon on a push button?
Anyone can help me? Trying to Add a Slow function with my smoothscroll and
Who can help me to translate this XML Schema pattern [0-9]+-([0-9]|K) to java regular
Who can help me with regular expression? I need to remove a part of
Hopefully someone can help here, it's incredibly frustrating! I have a couple of iOS
Perhaps you can help me find this in the docs. I'm using pound-quote to
Perhaps any of you can help me with this anoying problem. I have long
I hope you can help, I've tried for hours to understand mod rewrite but

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.