File:Historical forex reserves.png

Size of this preview: 220 × 125 pixels. Other resolutions: 320 × 182 pixels | 2,890 × 1,643 pixels.
Original file (2,890 × 1,643 pixels, file size: 157 KB, MIME type: image/png)
This file is from a shared repository and may be used by other projects. The description on its file description page there is shown below.
Summary
| DescriptionHistorical forex reserves.png |
English: Source: [1] On the right under "Download", click on CSV.
The following the R code was used to generate the image, after some cleanup of the CSV: library(dplyr)
library(tidyr)
library(ggplot2)
# prepare data in long form
reserves = read.csv("reserves.csv") %>%
rename(Country = 1) %>% # Rename the first column to "Country"
pivot_longer(
cols = starts_with("X"),
names_to = "Year",
values_to = "Reserves"
) %>%
mutate(
Year = as.numeric(sub("^X", "", Year)), # Clean and convert Year
Country = factor(Country, levels = c(
"China", "Japan", "Switzerland",
"United States", "India", "Russia" # Custom country order
))
)
# for finding top countries
reserves.2023 = reserves %>% filter(Year==2023)
# dark theme
my.theme = theme(plot.title = element_text(size=25, family="serif",color='#e6e6e6',hjust=.5),
axis.text = element_text(color='#bfbfbf'),
axis.title.x = element_blank(),
axis.title.y = element_text(size=15, face="bold",color='#e6e6e6'),
legend.title = element_text(size=15, face="bold",color='#e6e6e6',hjust=.5),
legend.background = element_blank(),
legend.text = element_text(color='#e6e6e6',size=12),
panel.background = element_rect(fill = '#202020', color = '#404040'),
plot.background = element_rect(fill = '#181818', color = '#404040'),
panel.grid.minor = element_blank(),
panel.grid.major = element_line(color='#404040'),
plot.margin = unit(c(.5,.8,.5,.8), "cm"))
# graph with US
ggplot(reserves, aes(x=Year, y=Reserves/10^9, fill=Country)) +
geom_area(alpha=1) +
scale_x_continuous(breaks = seq(2000,2023, by=5)) +
labs(title="Historical forex reserves (including gold)",
x="Year", y="Reserves (billions USD)") +
my.theme
# ggsave("Historical forex reserves.png") # disabled for now
# graph without US
reserves.CJSIR = reserves %>% filter(Country != "United States")
ggplot(reserves.CJSIR, aes(x=Year, y=Reserves/10^9, fill=Country)) +
geom_area(alpha=1) +
scale_x_continuous(breaks = seq(2000,2023, by=5)) +
labs(title="Historical forex reserves (including gold)",
x="Year", y="Reserves (billions USD)") +
my.theme
ggsave("Historical forex reserves.png")
|
| Date | |
| Source | Own work |
| Author | Wizmut |
Licensing
I, the copyright holder of this work, hereby publish it under the following license:
| This file is made available under the Creative Commons CC0 1.0 Universal Public Domain Dedication. | |
| The person who associated a work with this deed has dedicated the work to the public domain by waiving all of their rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission.
http://creativecommons.org/publicdomain/zero/1.0/deed.enCC0Creative Commons Zero, Public Domain Dedicationfalsefalse |
- ↑ Total reserves (includes gold, current US$). World Bank. Retrieved on 24 November 2024.
Captions
Foreign exchange reserves for the top 5 countries
Items portrayed in this file
depicts
24 November 2024
image/png
160,302 byte
1,643 pixel
2,890 pixel
4144c0b8999e6d53514ed25ebf09e0941bfde174
File history
Click on a date/time to view the file as it appeared at that time.
| Date/Time | Thumbnail | Dimensions | User | Comment | |
|---|---|---|---|---|---|
| current | 01:47, 25 November 2024 | ![]() | 2,890 × 1,643 (157 KB) | smartcommons>Wizmut | Uploaded own work with UploadWizard |
File usage
There are no pages that use this file.
Retrieved from "https://en.bharatpedia.org/wiki/File:Historical_forex_reserves.png"