Graphics, Figures & TablesAbline text not appearing in final pdf output

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
kama1977
Posts: 3
Joined: Sat Jan 27, 2018 3:25 am

Abline text not appearing in final pdf output

Post by kama1977 »

I have the following procedure. I see the abline text when processing chunk. However when compiling pdf the text does not appear. Anyone knows what is causing this?

abline(h="191", col="red")
text(11000, 200, pos = 4, "hello", col = 1, cex = 0.9)

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
TikZ book
User avatar
Stefan Kottwitz
Site Admin
Posts: 10314
Joined: Mon Mar 10, 2008 9:44 pm

Abline text not appearing in final pdf output

Post by Stefan Kottwitz »

Hi,

welcome to the forum!

What is abline? Can you show code?

Stefan
LaTeX.org admin
kama1977
Posts: 3
Joined: Sat Jan 27, 2018 3:25 am

Abline text not appearing in final pdf output

Post by kama1977 »

hello Stephan

thank you. my procedure in original post is part of chunk in R. I am failing to get the text label of the abline to appear in the final output. See below:

<<r131, echo=FALSE, fig=TRUE, width=10, height=13, results=hide>>=
par(mfrow = c(3, 1))

# First plot - Series 1 (SO2-10min)

mydata <- import("C:/CoT Reports/December 2017/Tshwane_SO2_10min-December_2017.csv", date = "date", date.format = "%d-%m-%Y %H:%M")

plot(mydata$date, mydata$Bodibeng,
type = "l",
col="orange", ylim = c(0.0,300),
xlab = "Day of Month",
ylab = expression(paste(SO[2], " (ppb)")))
title(main=expression(paste(SO[2], " Ten Minute (10 Min) Averages")))
par(new=T)


# First plot - Series 2 (SO2-10min)
plot(mydata$date, mydata$Olievenhoutbosch,
type = "l",
col="turquoise", ylim = c(0.0,300), xlab='', ylab='', axis = T)
par(new=T)

# First plot - Series 3 (SO2-10min)
plot(mydata$date, mydata$Booysens,
type = "l",
col="blue", ylim = c(0.0,300), xlab='', ylab='', axis = T)
par(new=T)

# First plot - Series 3 (SO2-10min)
plot(mydata$date, mydata$TshwaneMarket,
type = "l",
col="brown", ylim = c(0.0,300), xlab='', ylab='', axis = T)
par(new=T)

# First plot - Series 4 (SO2-10min)
plot(mydata$date, mydata$Hammanskraal,
type = "l",
col="purple", ylim = c(0.0,300), xlab='', ylab='', axis = T)
par(new=F)

abline(h="191", col="red")
text(11000, 200, "hello", pos = 4, col = "red", cex = 0.9)

grid(NULL, NULL, col = "dark grey", lty = "dotted",
lwd = par("lwd"), equilogs = TRUE)

legend("top", legend=c("Bodibeng", "Tshwane Market", "Olievenhoutbosch", "Booysens", "Hammanskraal"),
col=c("orange", "turquoise", "blue", "brown", "purple"), lty=1:1, horiz=TRUE, cex=0.9)
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Abline text not appearing in final pdf output

Post by Johannes_B »

I would ask in an R forum.
This forum is about LaTeX.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10314
Joined: Mon Mar 10, 2008 9:44 pm

Abline text not appearing in final pdf output

Post by Stefan Kottwitz »

Hi,

if the PDF compiling fails when you use LaTeX code (exported from R) then please show the LaTeX code. I can fix LaTeX issues with that, but not work with R.

Stefan
LaTeX.org admin
kama1977
Posts: 3
Joined: Sat Jan 27, 2018 3:25 am

Abline text not appearing in final pdf output

Post by kama1977 »

thank you for responses

Stefan my problem is with R code

thank you for pointing me in the right direction
Post Reply