Dear R People,
I want to include a barplot corresponding to a simple discrete probability
distribution in a LaTeX document. I decided to use the pictex
driver. After a certain amount of messing about, I came up the stuff
below. It does not look too bad, however, there is one very obvious piece
of weirdness, ie. the y axis terminates at 0.1 and does not extend down
further. I tried to adjust this by changing ylim to c(-0.1,0.5) but then
the labelling -3, -2 ... moves further down. Can anyone suggest how to
correct this problem?
I am not sure what significance xlim has in this situation. I set it equal
to c(-3,10) but then it cut off half the graph. So I just left it off.
Yes, I did look at the online help, but still had difficulties.
Two more comments: 1) If anyone can suggest a better way of doing this,
please let me know. 2) Are there any obvious advantages to using pictex
instead of say eps? I thought there might be an advantage to being able to
adjust parameters by hand, but the pictex code that is put out by the
driver is quite complicated, and in any case no documentation comes for
pictex (you have to buy the manual), so I don't know what I am doing
anyway.
pictex(file="barplot.tex",width=6,height=3, debug=FALSE,bg
="white",fg="black")
barplot(c(0.1,0.2,0.2,0.4,0,0,0,0,0,0,0,0,0,0.1),names.arg
c("-3","-2","-1","0","1","2","3","4","5","6","7","8","9","10"),
ylim=c(0,0.5),xlab="Values of x",ylab="Probability
values",sub=NULL,
style="old",main="Probability Histogram")
dev.off()
Sincerely, Faheem Mitha.
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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 subject !) To: r-help-request at
stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Tue, 6 Feb 2001, Faheem Mitha wrote:> Dear R People, > > I want to include a barplot corresponding to a simple discrete probability > distribution in a LaTeX document. I decided to use the pictex > driver. After a certain amount of messing about, I came up the stuff > below. It does not look too bad, however, there is one very obvious piece > of weirdness, ie. the y axis terminates at 0.1 and does not extend down > further. I tried to adjust this by changing ylim to c(-0.1,0.5) but then > the labelling -3, -2 ... moves further down. Can anyone suggest how to > correct this problem?Not so in my version (1.2.1, Solaris) with your code. What version are *you* using? This has been fixed a while ago (1.1.0, it looks like from NEWS).> I am not sure what significance xlim has in this situation. I set it equal > to c(-3,10) but then it cut off half the graph. So I just left it off. > Yes, I did look at the online help, but still had difficulties. > > Two more comments: 1) If anyone can suggest a better way of doing this, > please let me know. 2) Are there any obvious advantages to using pictex > instead of say eps?None if your dvixx can handle eps. The pictex driver has not been touched for a long time and has no font metric support, for example. These days you can use TeX fonts with postscript(), anyway. [ ... ] -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
This didn't seem to go through (perhaps because of the capital R) so I am
resending it. Faheem.
---------- Forwarded message ----------
Date: Tue, 6 Feb 2001 14:36:53 -0500 (EST)
From: Faheem Mitha <faheem at email.unc.edu>
To: R-help at stat.math.ethz.ch
Subject: barplots with pictex
Dear R People,
I want to include a barplot corresponding to a simple discrete probability
distribution in a LaTeX document. I decided to use the pictex
driver. After a certain amount of messing about, I came up the lines
below. It does not look too bad, however, there is one very obvious piece
of weirdness, ie. the y axis terminates at 0.1 and does not extend down
further. I tried to adjust this by changing ylim to c(-0.1,0.5) but then
the labelling -3, -2 ... moves further down. Can anyone suggest how to
correct this problem?
I am not sure what significance xlim has in this situation. I set it equal
to c(-3,10) but then it cut off half the graph. So I just left it off.
Yes, I did look at the online help, but still had difficulties.
Two more comments/questions:
1) If anyone can suggest a better way of doing this, please let me know.
2) Are there any obvious advantages to using pictex instead of say eps? I
thought there might be an advantage to being able to adjust parameters by
hand, but the pictex code that is put out by the driver is quite
complicated, and in any case no documentation comes for pictex (you have
to buy the manual), so I don't know what I am doing anyway.
pictex(file="barplot.tex",width=6,height=3, debug=FALSE,bg
="white",fg="black")
barplot(c(0.1,0.2,0.2,0.4,0,0,0,0,0,0,0,0,0,0.1),names.arg
c("-3","-2","-1","0","1","2","3","4","5","6","7","8","9","10"),
ylim=c(0,0.5),xlab="Values of x",ylab="Probability
values",sub=NULL,
style="old",main="Probability Histogram")
dev.off()
Thanks in advance for any help.
Sincerely, Faheem Mitha.
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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 subject !) To: r-help-request at
stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._