Recently Published
Gasoline Prices in New York State – Weekly and Quarterly Trends
This code sets up a two-row plotting layout with par(mfrow = c(2,1)) and increases the bottom margin using mar = c(6,4,4,2) to make space for text. The first plot displays weekly gasoline prices in New York State as a red line, with a descriptive paragraph added below using mtext() to explain the dataset, the observed trends in 2025, the units in dollars per gallon, and the weekly variations across the state. The second plot shows quarterly average prices in green, again with a paragraph added below describing that the data is aggregated from weekly values, highlighting smoothed trends, units, and long-term price movements in New York State. The cex = 0.8 parameter reduces the text size so the paragraphs fit neatly under the plots.
Gas Prices Over Time by City
This visualization illustrates how gas prices change over time across different cities.
The X-axis represents dates, while the Y-axis shows gas prices in dollars per gallon.
Each colored line corresponds to a city, allowing comparison of trends among locations.
A minimal theme and right-aligned legend keep the focus on the time-series patterns.
Plot
Purpose: Plots New York City gas prices over time as a line graph.
Data & Mapping: aes(Date, New_York_City) maps the X-axis to dates and Y-axis to gas prices.
Appearance: geom_line(color="red", linewidth=1) draws a red line; theme_minimal() gives a clean background.
Labels: labs() sets the title and axis labels for clarity.
Plot
The purpose of this command is to visualize the variation of gas prices in New York City over time. A line plot is chosen (type="l") to show the trend clearly.
Plot
Date is on the x-axis, Price on the y-axis.
type="l" creates a line plot.
col="red" sets the line color, lwd=2 makes it thicker.
This avoids the “figure margins too large” error if your plot pane is visible and has space.