Re: [R] set linetype with plotCI

2006-10-16 Thread JeeBee
Sorry, the plot_linetypes[1] is a debugging leftover.
It's plot_linetypes[graph_idx] in my actual code ...
And plot_linetypes is just the sequence 1,2,3,4... etc

 plotCI(
   x = xvals.f[sorted],
   y = yvals.f[sorted],
   xlim = c(xmin, xmax), ylim = c(ymin, ymax),
   pch = plot_symbols[graph_idx], type = b,
 lty = plot_linetypes[1],
   col = plot_colors[graph_idx], 
 barcol = plot_colors[graph_idx], uiw = NA,
   xlab = , ylab = ,
   add = (plot_cnt  0)
 )

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] set linetype with plotCI

2006-10-16 Thread David Barron
You could look at the plotCI function in the plotrix package, which
has a separate parameter for setting the linetype of the error bars.

(An additional benefit is that it works with R 2.4.0 -- gplots seems
not to have been updated, or at least the windows binary hasn't, and
still includes a now defunct feature.)

On 16/10/06, JeeBee [EMAIL PROTECTED] wrote:
 Sorry, the plot_linetypes[1] is a debugging leftover.
 It's plot_linetypes[graph_idx] in my actual code ...
 And plot_linetypes is just the sequence 1,2,3,4... etc

  plotCI(
x = xvals.f[sorted],
y = yvals.f[sorted],
xlim = c(xmin, xmax), ylim = c(ymin, ymax),
pch = plot_symbols[graph_idx], type = b,
  lty = plot_linetypes[1],
col = plot_colors[graph_idx],
  barcol = plot_colors[graph_idx], uiw = NA,
xlab = , ylab = ,
add = (plot_cnt  0)
  )

 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.



-- 
=
David Barron
Said Business School
University of Oxford
Park End Street
Oxford OX1 1HP

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] set linetype with plotCI

2006-10-16 Thread JeeBee
Thanks, I tried using plotCI in the plotrix library.
This, however, gives me the below error.

CODE::
  cat(x = ); print(xvals.f[sorted])
  cat(y = ); print(yvals.f[sorted])
  cat(pch = ); print(plot_symbols[graph_idx])
  cat(lty = ); print(plot_linetypes[graph_idx])
  cat(col = ); print(plot_colors[graph_idx])
  print(paste(graph_idx =, graph_idx, and plot_cnt =, plot_cnt))
  plotCI(
x = xvals.f[sorted],
y = yvals.f[sorted],
xlim = c(xmin, xmax), ylim = c(ymin, ymax),
pch = plot_symbols[graph_idx], type = b,
lty = plot_linetypes[graph_idx],
col = plot_colors[graph_idx], 
barcol = plot_colors[graph_idx], uiw = NA,
xlab = , ylab = ,
add = (plot_cnt  0)
  )
  print(plotCI succeeeded...)

OUTPUT::

x =  [1] 160 160 160 160 160 160 160 160 160 160 320 320 320 320 320 320 320 
320 320
[20] 480 480 480 480 480 480 480 480 480 640 640 640 640 640 640 640 640 800 800
[39] 800 800 800 800 800 800 800 960 960 960 960 960 960 960 960 960
y =  [1] 0.062263829 0.062263829 0.062263829 0.062263829 0.062263829 0.062263829
 [7] 0.062263829 0.062263829 0.062263829 0.062263829 0.029483948 0.029483948
[13] 0.029483948 0.029483948 0.029483948 0.029483948 0.029483948 0.029483948
[19] 0.029483948 0.018035707 0.018035707 0.018035707 0.018035707 0.018035707
[25] 0.018035707 0.018035707 0.018035707 0.018035707 0.009895540 0.009895540
[31] 0.009895540 0.009895540 0.009895540 0.009895540 0.009895540 0.009895540
[37] 0.008534913 0.008534913 0.008534913 0.008534913 0.008534913 0.008534913
[43] 0.008534913 0.008534913 0.008534913 0.007301515 0.007301515 0.007301515
[49] 0.007301515 0.007301515 0.007301515 0.007301515 0.007301515 0.007301515
pch = [1] 0
lty = [1] 1
col = [1] #FF
[1] graph_idx = 1 and plot_cnt = 0
Error in plot.default(c(160, 160, 160, 160, 160, 160, 160, 160, 160, 160,  :
formal argument type matched by multiple actual arguments

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] set linetype with plotCI

2006-10-16 Thread David Barron
Looking at the source code for plotCI, I see that it calls plot with
type specified as n when  the error bars are not being added to an
existing plot, so you cannot use the type argument in a call to
plotCI.  If you want to add lines as well as points, I think you will
have to use lines(x,y,type=b,lty = plot_linetypes[graph_idx]) in
addition to plotCI, or amend the plotCI function to your own
specifications.

On 16/10/06, JeeBee [EMAIL PROTECTED] wrote:
 Thanks, I tried using plotCI in the plotrix library.
 This, however, gives me the below error.

 CODE::
   cat(x = ); print(xvals.f[sorted])
   cat(y = ); print(yvals.f[sorted])
   cat(pch = ); print(plot_symbols[graph_idx])
   cat(lty = ); print(plot_linetypes[graph_idx])
   cat(col = ); print(plot_colors[graph_idx])
   print(paste(graph_idx =, graph_idx, and plot_cnt =, plot_cnt))
   plotCI(
 x = xvals.f[sorted],
 y = yvals.f[sorted],
 xlim = c(xmin, xmax), ylim = c(ymin, ymax),
 pch = plot_symbols[graph_idx], type = b,
 lty = plot_linetypes[graph_idx],
 col = plot_colors[graph_idx],
 barcol = plot_colors[graph_idx], uiw = NA,
 xlab = , ylab = ,
 add = (plot_cnt  0)
   )
   print(plotCI succeeeded...)

 OUTPUT::

 x =  [1] 160 160 160 160 160 160 160 160 160 160 320 320 320 320 320 320 320 
 320 320
 [20] 480 480 480 480 480 480 480 480 480 640 640 640 640 640 640 640 640 800 
 800
 [39] 800 800 800 800 800 800 800 960 960 960 960 960 960 960 960 960
 y =  [1] 0.062263829 0.062263829 0.062263829 0.062263829 0.062263829 
 0.062263829
  [7] 0.062263829 0.062263829 0.062263829 0.062263829 0.029483948 0.029483948
 [13] 0.029483948 0.029483948 0.029483948 0.029483948 0.029483948 0.029483948
 [19] 0.029483948 0.018035707 0.018035707 0.018035707 0.018035707 0.018035707
 [25] 0.018035707 0.018035707 0.018035707 0.018035707 0.009895540 0.009895540
 [31] 0.009895540 0.009895540 0.009895540 0.009895540 0.009895540 0.009895540
 [37] 0.008534913 0.008534913 0.008534913 0.008534913 0.008534913 0.008534913
 [43] 0.008534913 0.008534913 0.008534913 0.007301515 0.007301515 0.007301515
 [49] 0.007301515 0.007301515 0.007301515 0.007301515 0.007301515 0.007301515
 pch = [1] 0
 lty = [1] 1
 col = [1] #FF
 [1] graph_idx = 1 and plot_cnt = 0
 Error in plot.default(c(160, 160, 160, 160, 160, 160, 160, 160, 160, 160,  :
 formal argument type matched by multiple actual arguments

 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.



-- 
=
David Barron
Said Business School
University of Oxford
Park End Street
Oxford OX1 1HP

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] set linetype with plotCI

2006-10-16 Thread JeeBee

Great, why didn't I think of that.
Thanks :)

 If you want to add lines as well as points, I think you will
 have to use lines(x,y,type=b,lty = plot_linetypes[graph_idx]) in
 addition to plotCI,

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.