192:# Reproducible R code # Load necessary libraries library(ggplot2) library(patchwork) # Set seed for reproducibility set.seed(123) # Generate data n <- 10000 x <- sort(runif(n, min = 1, max = 100)) intercept <- 0.000001 slope <- 0.5 y_true_log <- intercept + slope * log10(x) noise <- rnorm(n, mean = 0, sd = .1) y_observed_log <- y_true_log + noise y_observed <- 10^y_observed_log y_true <- 10^y_true_log # Create data frame df <- data.frame(x = x, y_true = y_true, y_observed = y_observed) # For jupyter notebook options( repr.plot.width = 20, # in inches (default = 7) repr.plot.height = 10 # in inches (default = 7) ) # Plot data p1 <- ggplot(df, aes(x = x, y = y_observed)) + geom_point() + geom_line(aes(y = y_true, color = 'Median line'), size = 3) + geom_smooth(aes(color = 'Mean line'), size = 3, se = F) + coord_cartesian(ylim = c(0, 20)) + # Set the limits of the plot without excluding obs scale_color_manual(values = c('Median line' = 'red', 'Mean line' = 'blue')) + theme_bw() + theme(text = element_text(size = 25)) + theme(legend.position="bottom") + labs(x = 'X', y = 'Y', title = 'Concave Line with Log-Normal Noise') p2 <- ggplot(df, aes(x = x, y = y_observed)) + geom_point() + geom_line(aes(y = y_true, color = 'Mean and Median line'), size = 3) + scale_x_log10() + scale_y_log10() + scale_color_manual(values = c('Mean and Median line' = 'red')) + theme_bw() + theme(text = element_text(size = 25)) + theme(legend.position="bottom") + labs(x = 'X (log scale)', y = 'Y (log scale)', title = 'Log-Log Linear Line with Normal Noise') p1 + p2 + plot_annotation( title = 'Visualizing Loglog Normal Data: Scatter-plots in Original and Log10 Scales', theme = theme(plot.title = element_text(hjust = 0.5, size = 40)) )
38:
209:
215:
94:
150:
The first plot, titled 'Concave Line with Log-Normal Noise', displays a scatter plot of the observed data (y_observed) against the independent variable (x). The red line represents the 'Median line', while the blue line is the 'Mean line'. The y-axis is limited to a range of 0 to 20.
607:
153:
The second plot, titled 'Log-Log Linear Line with Normal Noise', also displays a scatter plot of the observed data against the independent variable, but both axes are on a logarithmic scale. Here, both the mean and median lines are the same (red)
256:– 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.
643:
60:
56:
183:
52:
48:
42:
105:
73:
552:
448:
412:
654:
This file contains additional information, probably added from the digital camera or scanner used to create or digitize it.
536:
502:
396:
368:
355:
468:
432:
328:
311:
375:
657:
If the file has been modified from its original state, some details may not fully reflect the modified file.
225:
222:
606:
601:
64:
37:
113:
638:
617:
100:
202:
I, the copyright holder of this work, hereby publish it under the following license:
163:
295:
Visualizing Loglog Normal Data: Scatter-plots in
Original and Log10 Scales
148:
This image presents two plots generated from a dataset of 10,000 points.
574:
Click on a date/time to view the file as it appeared at that time.
88:
644:
User:Talgalili/sandbox/Log transformation (statistics)
78:(2,400 × 1,200 pixels, file size: 439 KB, MIME type:
132:
112:
Commons is a freely licensed media file repository.
449:Creative Commons Attribution 4.0 International
93:
208:
8:
263:https://creativecommons.org/licenses/by/4.0
239:– to copy, distribute and transmit the work
659:
576:
291:
669:
661:
636:
550:
534:
516:
500:
482:
466:
446:
430:
410:
394:
342:
326:
309:
306:
287:
280:
634:The following 2 pages use this file:
7:
624:Uploaded own work with UploadWizard
565:
214:
652:
300:
294:
230:
205:
201:
142:
138:Visualizing Loglog Normal Data.png
125:
71:
299:
269:Creative Commons Attribution 4.0
285:
250:Under the following conditions:
221:This file is licensed under the
213:
207:
92:
21:
282:
143:
14:
281:
26:
1:
553:original creation by uploader
226:Attribution 4.0 International
31:
307:Items portrayed in this file
691:
566:
173:
16:
284:
99:This is a file from the
623:
179:
169:
162:
159:
135:
103:. Information from its
106:description page there
41:Size of this preview:
663:Horizontal resolution
602:11:25, 15 April 2024
65:2,400 × 1,200 pixels
671:Vertical resolution
245:– to adapt the work
47:Other resolutions:
369:Wikimedia username
356:author name string
61:1,280 × 640 pixels
57:1,024 × 512 pixels
678:
677:
627:
433:copyright license
293:
189:
188:
121:
120:
101:Wikimedia Commons
682:
660:
614:
397:copyright status
378:
373:
363:
360:
276:
273:
270:
267:
264:
223:Creative Commons
217:
216:
211:
210:
175:
165:
147:
139:
133:
117:
96:
95:
89:
83:
81:
68:
53:640 × 320 pixels
49:320 × 160 pixels
43:800 × 400 pixels
690:
689:
685:
684:
683:
681:
680:
679:
648:
628:
620:
612:
568:
567:
564:
563:
562:
561:
560:
559:
558:
557:
555:
543:
542:
541:
539:
528:
527:
526:
525:
524:
523:
522:
521:
519:
509:
508:
507:
505:
494:
493:
492:
491:
490:
489:
488:
487:
485:
475:
474:
473:
471:
460:
459:
458:
457:
456:
455:
454:
453:
451:
439:
438:
437:
435:
424:
423:
422:
421:
420:
419:
418:
417:
415:
403:
402:
401:
399:
388:
387:
386:
385:
384:
383:
382:
381:
380:
379:
374:
371:
365:
364:
361:
358:
349:
348:
347:
345:
335:
334:
333:
331:
320:
319:
318:
317:
316:
314:
298:
297:
296:
279:
278:
277:
274:
271:
268:
265:
262:
261:
229:
218:
204:
203:
198:
193:
190:
155:
137:
130:
123:
122:
111:
110:
109:is shown below.
85:
79:
77:
70:
69:
46:
12:
11:
5:
688:
686:
676:
675:
672:
668:
667:
664:
651:
647:
646:
641:
632:
631:
626:
625:
622:
618:
615:
611:2,400 × 1,200
609:
604:
599:
595:
594:
591:
588:
585:
582:
579:
572:
571:
556:
551:
549:
548:
547:
546:
545:
544:
540:
537:source of file
535:
533:
532:
531:
530:
529:
520:
517:
515:
514:
513:
512:
511:
510:
506:
501:
499:
498:
497:
496:
495:
486:
483:
481:
480:
479:
478:
477:
476:
472:
467:
465:
464:
463:
462:
461:
452:
447:
445:
444:
443:
442:
441:
440:
436:
431:
429:
428:
427:
426:
425:
416:
411:
409:
408:
407:
406:
405:
404:
400:
395:
393:
392:
391:
390:
389:
367:
366:
354:
353:
352:
351:
350:
346:
343:
341:
340:
339:
338:
337:
336:
332:
327:
325:
324:
323:
322:
321:
315:
310:
308:
305:
304:
303:
302:
301:
290:
289:
286:
283:
260:
259:
258:
257:
248:
247:
246:
240:
233:You are free:
220:
219:
206:
200:
199:
197:
194:
191:
187:
186:
181:
177:
176:
171:
167:
166:
161:
157:
156:
140:
131:
129:
126:
124:
119:
118:
97:
87:
86:
40:
36:
35:
34:
29:
24:
19:
13:
10:
9:
6:
4:
3:
2:
687:
673:
670:
665:
662:
658:
655:
649:
645:
642:
640:
637:
635:
629:
621:
616:
610:
608:
605:
603:
600:
597:
596:
592:
589:
586:
583:
580:
578:
577:
575:
569:
554:
538:
504:
484:15 April 2024
470:
450:
434:
414:
398:
377:
370:
357:
330:
313:
255:
252:
251:
249:
244:
241:
238:
235:
234:
232:
231:
227:
224:
212:
195:
185:
182:
178:
172:
168:
164:15 April 2024
158:
152:
146:
141:
134:
127:
115:
108:
107:
102:
98:
91:
90:
84:
75:
74:Original file
66:
62:
58:
54:
50:
44:
39:
33:
30:
28:
25:
23:
20:
18:
15:
656:
653:
639:Log–log plot
633:
573:
570:File history
253:
242:
236:
149:
144:
114:You can help
104:
72:
22:File history
413:copyrighted
254:attribution
136:Description
630:File usage
587:Dimensions
503:media type
344:some value
266:CC BY 4.0
27:File usage
674:47.24 dpc
666:47.24 dpc
619:Talgalili
584:Thumbnail
581:Date/Time
518:image/png
469:inception
376:Talgalili
362:Talgalili
196:Licensing
184:Talgalili
145:English:
80:image/png
650:Metadata
613:(439 KB)
288:Captions
243:to remix
237:to share
228:license.
174:Own work
32:Metadata
598:current
593:Comment
329:creator
312:depicts
292:English
128:Summary
76:
180:Author
170:Source
154:line.
590:User
275:true
272:true
160:Date
17:File
372::
359::
63:|
59:|
55:|
51:|
45:.
116:.
82:)
67:.
Text is available under the Creative Commons Attribution-ShareAlike License. Additional terms may apply.