-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathExamenGraficas.Rmd
64 lines (52 loc) · 1.22 KB
/
ExamenGraficas.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
---
title: "ExamenGraficas"
author: "Oscar Gerardo Hernández Martínez"
date: "24/7/2019"
output: pdf_document
---
## Ejercicios
### 1, 6
```{r}
curve(x^2 - 3*x + 30,
xlim = c(-15, 15),
xlab = expression(x),
ylab = expression(y = x^2 - 3*x + 30),
main = "Una parábola",
add = NA)
abline(2,7, col = "blue",
lwd = 2)
```
### 2
```{r}
f <- function(x){
x^2 - 3*x + 30
}
I =(-15:15) #No nos devuelve la misma gráfica
#ya que estamos tomando 15 elementos antes
#de llegar al 0 de la función y 15 elementos
#después del cero de la función.
plot(f(I),
xlab = expression(x),
ylab = expression(y = x^2 - 3*x + 30),
main = "Una parábola")
```
### 3
```{r}
curve(5*2^x,
xlim = c(-10, 25),
ylab = expression(5 %.% 2^x),
log = "y")
```
### 4, 5
```{r}
curve(3*x, xlim = c(-10,20),
col = "blue", main = "Dos rectas",
sub = "Dos rectas con pendiente opuesta")
curve(-3*x, xlim = c(-10,20),
col = "green", add = TRUE)
legend(13, 10, col = c("blue", "green"),
legend = c(expression(3*x),expression(-3*x)),
lty = 1, lwd = 2)
abline(h = 0, col = "red",
lwd = 5)
```