similar to: y-axis number format on plot, barplot etc.

Displaying 20 results from an estimated 9000 matches similar to: "y-axis number format on plot, barplot etc."

2008 May 29
7
How do you exit a function in R?
For example, based on a certain condition, I may want to exit my code early: # Are there the same number of assets in "prices" and "positions"? if (nAssetPositions != nAssetPrices) { cat("Different number of assets! \n\n") <exit function> } I have searched, but not
2003 Nov 07
1
barplot(names.arg) versus axis(labels)
Should I be able to use axis() on a barplot? i have a data.frame, the first 3 values of which are: > c[1:3,] median mean A1 56.5 58.50000 A61 73.0 73.00000 A62 63.0 63.00000 > str(c) `data.frame': 19 obs. of 2 variables: $ median: num 56.5 73 63 161 51 55 44.5 22 54 49 ... $ mean : num 58.5 73.0 63.0 161.0 47.5 ... if I do barplot(median) and then try
2007 Apr 07
2
Setting where the x-axis crosses the y-axis
Hi all, my apologies for a probably very obvious question but i can't figure out if, on a bar plot, there is a simple way to have the x-axis cross the y-axis at 1, when the y-axis is on a log-scale? I want to draw a bar plot, and have some of the bars "drop" below 1 while starting from 1. Is this possible? I have been trying various things using barplot, barplot2 etc... without
2009 Dec 03
2
Formatting of numbers on y axis
Hello all. I have the following: plot(salaries$yearID, salaries$salary, type='n', xaxt='n', xlab='', yaxt='n', ylab='') axis(1, at=unique(salaries$yearID), labels=unique(salaries$yearID), lwd=.25, tck=-0.05) axis(2, axTicks(2), format(axTicks(2), scientific = F)) Which nicely creates the Y axis with the raw numbers, which are in the range of .5 - 7
2005 Nov 16
2
invert y-axis in barplot
Hi! This is probably a very trivial question. Is there an easy way to invert the y-axis (low values on top) when using the function barplot()? Thanks, Jörg [[alternative HTML version deleted]]
2011 Sep 22
2
How to adjust the y-axis range in barplot properly
Hello R-Users, it might be a rather simple problem I have, but I couldn't find any solution online. Thus, here is my problem: I would like to adjust the y-axis range in a barplot, since all my values are >70. Therefore I would like to only visualize the y-axis from 60-100 (example 1). The problem is, the range of the y-axis is adjusted, but the barsize stays the same and vanishes from
2002 Jul 08
1
Horizontal barplot with reversed y-axis
Dear Reader, I need a horizontal barplot but with the lowest value on the y-axis on top. How to get this? Thank you, osiander at 24on.cc -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the
2010 Dec 09
1
Barplot with "Independent" Lines Y axis
Hi list. I'm plotting pluviometric (Rain) data as a barplot, and then adding the salinity variable to this plot as lines. Obviously as these Y scales are completely different the salinity appears at the lower part of the graph extremely compacted. I need to plot the line at the exactly same area of the barplot but with its own Y axis (at the right), so the salinity can use the plot area
2010 Feb 02
2
barplot y axis too short
Hello, The function barplot automatically creates a y-axis that doesn't necessarily cover the range of y-values to be plotted. I know how to manually create my own y-axis so that it does cover the range, but I was wondering if there is some parameter to change so that the scale of the y-axis is automatically taller than the tallest bar. I thought setting xpd=F would do it, since it says that
2008 Feb 26
1
changing format of y-axis (barplot)
Dear all, I have some data.frame and I would like (1) change the format of y=axis to escape of scientific format (like 1e+05...) and (2) label the value or other variable on the top of the bar. df<-data.frame(x=1:6,y=c(100,500,1000,25000,500000,1000000)) barplot(df$y,names.arg=df$x) Thanks in advance, miltinho Brazil [[alternative HTML version deleted]]
2008 Sep 05
1
Using R to generate reports
Hi all, I would like to generate nicely formatted reports on a daily basis. The reports would be a combination of charts and tables, generated in an environment such as R. Ideally, this would be an automated process. Does anyone know if this is feasible, and how I could achieve well formatted reports? One idea would be to have R scripts process the data/generate the charts and then use
2010 Sep 10
1
adding labels above bars in a barplot
Hello, I want to make a general routine to draw barplots with numbers plotted above each bar. See the example below. I could not place the numbers on the middle of each bar because I could not calculate the right position of each x-axis tick. axTicks(1) indicated a unitary step, but it does not seem work. I appreciate any help or suggestions. Best regards, Antonio Olinto
2009 Mar 17
2
Difficulty Replacing a Row of a Data Frame
I have the following data frames, avGain and retGain. They have the same dimensions. The following line of code replaces row j of avGain as desired: avGain[j, ] <- mean( retGain[jStart:j, ] ) However, the following line does not work: avGain[j, ] <- ( avGain[j-1, ] * ( DAYS - 1 ) + retGain[j, ] ) / DAYS If I do the following, and test to see if a or b are data frames.
2009 May 06
2
X and Y axis labels on a barplot
Dear all, I have produced a barplot and wish to alter the axes a little. In place of the variable names appearing on the x-axis, I'd like to have the numbers 1986 to 1995. I have tried using the argument xlim=c(1986,1995) in the barplot command but receive: "Error in plot.window(xlim, ylim, log = log, ...) : invalid 'xlim' value" Also, on the y-axis, the values are
2002 May 13
3
Histograms rotated, side-by-side
Hi there, I am wanting to create 8 side-by-side histograms which have been rotated 90 degrees clockwise from how they usually sit.. all with the same scales. Is someone able to help me out? Thanks so much, Rachel Cunliffe -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send
2006 Feb 16
1
R-help - Problem in drawing braplot with a huge value of data
Hello R-experts, I am facing a strange problem while creating a barplot. I have serise of data of which the first on is around 162589 while the remaining data are around 0-150. so when I am ploting the barplot with all the data I am getting a single line -> test1.jpg. But If I remove the 1st value i.e 162589 then I am getting a normal barplot -> test2.jpg Can some one help me regarding
2010 Dec 09
2
RES: Barplot with "Independent" Lines Y axis
Oh sorry. An example say lots more than words. The data below, when submitted to twoord.plot return the mentioned error. Rain are bars and Salt lines, the bars appear and the error occurs with the salt data. Point Rain Salt Fev/03 365.6 13 Mar/03 235 18 Abr/03 115.1 18 Mai/03 47.4 18.75 Jun/03 112 15 Jul/03 156.8 17 Ago/03 66.1 15 Set/03 149.8 14 Out/03 167,1 11.5 Nov/03 269.3 17.5 Dez/03 283.7
2012 May 07
2
y-axis-problem (barplots)
Ein eingebundener Text mit undefiniertem Zeichensatz wurde abgetrennt. Name: nicht verf?gbar URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20120507/f2dfaa17/attachment.pl>
2004 Apr 15
1
pretty for a log-axis
Is there a function that does the same as pretty but on a log-scale? Suppose you have x <- exp( runif( 100, 0, 6 ) ) (which will between 1 and 403), then I would like to have a result like: log.pretty( x ) [1] 1 5 10 50 100 500 Bendix C. ---------------------- Bendix Carstensen Senior Statistician Steno Diabetes Center Niels Steensens Vej 2 DK-2820 Gentofte Denmark tel: +45 44 43 87 38
2010 Feb 28
3
Change the scale on a barplot's y axis
I have grades data. I read them from a csv in letter-grade format. I then converted them to levels levels(grades$grade)=c('A+','A','A-','B+','B','B-','C+','C','C-','D+','D','D-') And then to numbers grades$gp=grades$grade levels(grades$gp)=c(4.3,4.0,3.7, 3.3,3.0,2.7, 2.3,2.0,1.7, 1.3,1.0,0.7)