Skip to content

Commit

Permalink
Align colour schemes in instance type plots (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
ateucher committed Aug 26, 2024
1 parent 7d83d28 commit 75e4a8f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions aws-usage-report/aws-usage-report.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ ec2_usage_plot <- ggplot(ec2_usage_data, aes(x = start_date, y = UsageQuantity,

```{r daily-cost-by-instance}
ec2_cost_data <- ec2_instance_type_costs_usage |>
mutate(instance_type = fct_reorder(instance_type, UnblendedCost, .fun = max))
mutate(instance_type = factor(instance_type, levels = levels(ec2_usage_data$instance_type)))
ec2_cost_plot <-
ggplot(ec2_cost_data, aes(x = start_date, y = UnblendedCost, fill = instance_type)) +
Expand Down Expand Up @@ -427,7 +427,8 @@ ec2_instance_data <- ec2_instance_type_costs_usage |>
summarize(
total_hours = sum(UsageQuantity),
total_cost = sum(UnblendedCost)
)
) |>
mutate(instance_type = factor(instance_type, levels = levels(ec2_cost_data$instance_type)))
ggplot(ec2_instance_data, aes(x = total_hours, y = total_cost, colour = instance_type)) +
geom_point(size = 3) +
Expand Down

0 comments on commit 75e4a8f

Please sign in to comment.