Nhập môn Trực quan hóa Dữ liệu với Julia
Gustavo Vieira Suñe
Data Analyst

tomato| Date | Giá (Rupee) |
|---|---|
| FEB-2004 | 10.0 |
| MAR-2004 | 12.0 |
| APR-2004 | 6.0 |
| MAY-2004 | 8.0 |
| ... | ... |
tomato.Date = sort(
tomato.Date, :Date
)
# Vẽ chuỗi thời gian plot( tomato.Date, tomato.Price,# Tùy chỉnh biểu đồ linewidth=2, linecolor=:tomato, label="Tomato" ) xlabel!("Date") ylabel!("Unit Price (Rupees)")

tomato| Date | Giá (Rupee) |
|---|---|
| APR-2004 | 6.0 |
| APR-2005 | 10.0 |
| APR-2006 | 8.0 |
| APR-2007 | 8.0 |
| ... | ... |
using Dates
birthday = Date("1989-12-04")
birthday = Date(
"1989/DEC/04", dateformat"y/u/d"
)
birthday = Date(
"Dec 4, 1989", dateformat"u d, y"
)
| Mã | Ý nghĩa | Ví dụ |
|---|---|---|
| Y/y | Năm (YYYY) | 1989, 2023 |
| m | Tháng (MM) | 1, 10 |
| u | Tháng viết tắt | Jan, DEC |
| U | Tên tháng | January, DECEMBER |
| d | Ngày (DD) | 4, 28 |
| H | Giờ (HH) | 12, 22 |
| M | Phút (MM) | 05, 25 |
| S | Giây (SS) | 10, 59 |
tomato.Date = Date.(
tomato.Date, dateformat"u-y"
)
tomato.Date = sort(
tomato.Date, :Date
)
| Date | Giá (Rupee) |
|---|---|
| 2004-02-01 | 10.0 |
| 2004-03-01 | 12.0 |
| 2004-04-01 | 6.0 |
| 2004-05-01 | 8.0 |
| ... | ... |
# Vẽ chuỗi thời gian
plot(
tomato.Date,
tomato.Price,
# Tùy chỉnh biểu đồ
linewidth=2,
linecolor=:tomato,
label="Tomato"
)
xlabel!("Date")
ylabel!("Unit Price (Rupees)")

# Hàng có giá cao nhất maximum_price = tomato[ argmax(tomato.Price), :]# Ghi chú trên biểu đồ annotate!( # Tọa độ maximum_price.Date, maximum_price.Price + 2,# Văn bản chú thích "Highest Price", annotationfontsize=8 )

Nhập môn Trực quan hóa Dữ liệu với Julia