File:Comparison of simple power law curves in original and log-log scale.png
Original file (1,200 × 1,560 pixels, file size: 110 KB, MIME type: image/png)
Captions
Summary[edit]
DescriptionComparison of simple power law curves in original and log-log scale.png |
English: R code to reproduce the image:
``` options( repr.plot.width = 10, # in inches (default = 7) repr.plot.height = 13 # in inches (default = 7) ) library(ggplot2) library(gridExtra)
linear_function <- function(x) x concave_function <- function(x) sqrt(x) convex_function <- function(x) x^2 identity_line <- function(x) x
x_values <- seq(0.001, 10, length.out = 1000) data_linear <- data.frame(x = x_values, y = linear_function(x_values)) data_concave <- data.frame(x = x_values, y = concave_function(x_values)) data_convex <- data.frame(x = x_values, y = convex_function(x_values))
plot_linear <- ggplot(data_linear, aes(x, y)) + geom_line() + geom_abline(intercept = 0, slope = 1, linetype = "dashed", color = "red") + ggtitle("Linear: y = x") + ylim(0,10) + xlim(0,10) plot_concave <- ggplot(data_concave, aes(x, y)) + geom_line() + geom_abline(intercept = 0, slope = 1, linetype = "dashed", color = "red") + ggtitle("Concave: y = x^(1/2)") + ylim(0,10) + xlim(0,10) plot_convex <- ggplot(data_convex, aes(x, y)) + geom_line() + geom_abline(intercept = 0, slope = 1, linetype = "dashed", color = "red") + ggtitle("Convex: y = x^2") + ylim(0,10) + xlim(0,10)
data_linear_log <- data.frame(x = log10(x_values), y = log10(linear_function(x_values))) data_concave_log <- data.frame(x = log10(x_values), y = log10(concave_function(x_values))) data_convex_log <- data.frame(x = log10(x_values), y = log10(convex_function(x_values))) plot_linear_log <- ggplot(data_linear_log, aes(x, y)) + geom_line() + geom_abline(intercept = 0, slope = 1, linetype = "dashed", color = "red") + ggtitle("Linear (Log10-Log10): y = x") + ylim(0,1) + xlim(0,1) plot_concave_log <- ggplot(data_concave_log, aes(x, y)) + geom_line() + geom_abline(intercept = 0, slope = 1, linetype = "dashed", color = "red") + ggtitle("Concave (Log10-Log10): y = x^(1/2)") + ylim(0,1) + xlim(0,1) plot_convex_log <- ggplot(data_convex_log, aes(x, y)) + geom_line() + geom_abline(intercept = 0, slope = 1, linetype = "dashed", color = "red") + ggtitle("Convex (Log10-Log10): y = x^2") + ylim(0,1) + xlim(0,1)
grid.arrange(plot_linear, plot_linear_log, plot_concave, plot_concave_log, plot_convex, plot_convex_log, ncol = 2, top = "Comparison of Linear, Concave, and Convex Functions\nIn original (left) and log10 (right) scales") ``` The R code provided above generates a grid of six plots, arranged in two columns and three rows, showcasing different mathematical functions both in their original scale and in a log10-log10 scale. The functions displayed include a linear function (y = x), a concave function (y = sqrt(x)), and a convex function (y = x^2). Each of these functions is depicted in two plots: one showing the relationship in its original scale and the other showing the relationship in a log10-log10 scale. In each plot: - The data is represented by a black line. - A dashed red line is included in each plot, representing a line with a 0 intercept and a slope of 1, for reference. - The x-axis and y-axis are labeled appropriately, with the axes in the log10-log10 plots labeled as log10(x) and log10(y). - Each plot has a title describing the function and indicating whether it is in the original scale or in the log10-log10 scale. This visualization serves to demonstrate how different types of mathematical relationships are represented both in their normal scale and when transformed into a logarithmic scale. |
Date | |
Source | Own work |
Author | Talgalili |
Licensing[edit]
- You are free:
- to share – to copy, distribute and transmit the work
- to remix – to adapt the work
- Under the following conditions:
- attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
- share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.
File history
Click on a date/time to view the file as it appeared at that time.
Date/Time | Thumbnail | Dimensions | User | Comment | |
---|---|---|---|---|---|
current | 13:21, 4 March 2024 | 1,200 × 1,560 (110 KB) | Talgalili (talk | contribs) | Uploaded own work with UploadWizard |
You cannot overwrite this file.
File usage on Commons
There are no pages that use this file.
File usage on other wikis
The following other wikis use this file:
- Usage on en.wikipedia.org
Metadata
This file contains additional information such as Exif metadata which may have been added by the digital camera, scanner, or software program used to create or digitize it. If the file has been modified from its original state, some details such as the timestamp may not fully reflect those of the original file. The timestamp is only as accurate as the clock in the camera, and it may be completely wrong.
Horizontal resolution | 47.24 dpc |
---|---|
Vertical resolution | 47.24 dpc |