Home > Back-end >  How to scale a barplot in ggplot2 with two variables when one variable is of the order of 1000 times
How to scale a barplot in ggplot2 with two variables when one variable is of the order of 1000 times

Time:05-23

I am comparing the execution times of binary search and linear search and displaying them using a bar plot.

But since the execution times of binary search are almost 1000 times less than linear search, the bars for binary search are barely visible.

Is there a way to fix this?

enter image description here

CodePudding user response:

I guess you are looking for scale_y_log10()?

CodePudding user response:

Try using micobenchmark? It’s really concise

https://www.r-bloggers.com/2015/01/using-the-microbenchmark-package-to-compare-the-execution-time-of-r-expressions/

  • Related