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)) )
497:"}},"text\/plain":{"en":{"":"inception"}}},"{\"value\":{\"time\":\"+2024-04-15T00:00:00Z\",\"timezone\":0,\"before\":0,\"after\":0,\"precision\":11,\"calendarmodel\":\"http:\\\/\\\/www.wikidata.org\\\/entity\\\/Q1985727\"},\"type\":\"time\"}":{"text\/html":{"en":{"P571":"15 April 2024"}},"text\/plain":{"en":{"P571":"15 April 2024"}}}}": -->
38:
209:
321:
94:
333:"}},"text\/plain":{"en":{"P2093":"Talgalili","P4174":"Talgalili"}}},"{\"value\":{\"entity-type\":\"property\",\"numeric-id\":4174,\"id\":\"P4174\"},\"type\":\"wikibase-entityid\"}":{"text\/html":{"en":{"":"
453:"}},"text\/plain":{"en":{"":"copyright license"}}},"{\"value\":{\"entity-type\":\"item\",\"numeric-id\":20007257,\"id\":\"Q20007257\"},\"type\":\"wikibase-entityid\"}":{"text\/html":{"en":{"P275":"
409:"}},"text\/plain":{"en":{"":"copyright status"}}},"{\"value\":{\"entity-type\":\"item\",\"numeric-id\":50423863,\"id\":\"Q50423863\"},\"type\":\"wikibase-entityid\"}":{"text\/html":{"en":{"P6216":"
573:"}},"text\/plain":{"en":{"":"source of file"}}},"{\"value\":{\"entity-type\":\"item\",\"numeric-id\":66458942,\"id\":\"Q66458942\"},\"type\":\"wikibase-entityid\"}":{"text\/html":{"en":{"P7482":"
535:"}},"text\/plain":{"en":{"":"media type"}}},"{\"value\":\"image\\\/png\",\"type\":\"string\"}":{"text\/html":{"en":{"P1163":"image\/png"}},"text\/plain":{"en":{"P1163":"image\/png"}}}}": -->
325:"}},"text\/plain":{"en":{"":"creator"}}},"{\"value\":{\"entity-type\":\"property\",\"numeric-id\":2093,\"id\":\"P2093\"},\"type\":\"wikibase-entityid\"}":{"text\/html":{"en":{"":"
569:
329:"}},"text\/plain":{"en":{"":"author name string"}}},"{\"value\":\"Talgalili\",\"type\":\"string\"}":{"text\/html":{"en":{"P2093":"Talgalili","P4174":"
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.
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.
330:
574:
454:
410:
570:
532:
406:
334:
326:
494:
450:
322:
691:
60:
56:
183:
52:
48:
42:
105:
73:
457:"}},"text\/plain":{"en":{"P275":"Creative Commons Attribution 4.0 International"}}}}": -->
600:
480:
436:
702:
This file contains additional information, probably added from the digital camera or scanner used to create or digitize it.
584:
542:
420:
384:
371:
577:"}},"text\/plain":{"en":{"P7482":"original creation by uploader"}}}}": -->
504:
464:
344:
311:
391:
705:
If the file has been modified from its original state, some details may not fully reflect the modified file.
225:
337:"}},"text\/plain":{"en":{"":"Wikimedia username"}}}}": -->
413:"}},"text\/plain":{"en":{"P6216":"copyrighted"}}}}": -->
654:
649:
64:
37:
113:
222:
8:
100:
301:
202:
I, the copyright holder of this work, hereby publish it under the following license:
686:
665:
594:
552:
514:
474:
430:
354:
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.
622:
Click on a date/time to view the file as it appeared at that time.
163:
88:
692:
User:Talgalili/sandbox/Log transformation (statistics)
680:
78:(2,400 × 1,200 pixels, file size: 439 KB, MIME type:
620:
112:
Commons is a freely licensed media file repository.
481:Creative Commons Attribution 4.0 International
455:Creative Commons Attribution 4.0 International
93:
208:
159:
135:
179:
169:
14:
263:https://creativecommons.org/licenses/by/4.0
239:– to copy, distribute and transmit the work
682:The following 2 pages use this file:
124:
672:Uploaded own work with UploadWizard
613:
214:
13:
700:
300:
294:
230:
205:
201:
142:
138:Visualizing Loglog Normal Data.png
125:
71:
734:
707:
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:
617:
281:
26:
1:
601:original creation by uploader
575:original creation by uploader
226:Attribution 4.0 International
31:
677:
307:Items portrayed in this file
195:
7:
697:
10:
739:
132:
127:
614:
173:
16:
284:
99:This is a file from the
36:
671:
162:
103:. Information from its
106:description page there
41:Size of this preview:
711:Horizontal resolution
650:11:25, 15 April 2024
65:2,400 × 1,200 pixels
719:Vertical resolution
245:– to adapt the work
47:Other resolutions:
385:Wikimedia username
372:author name string
335:Wikimedia username
327:author name string
61:1,280 × 640 pixels
57:1,024 × 512 pixels
726:
725:
675:
465:copyright license
451:copyright license
293:
189:
188:
121:
120:
101:Wikimedia Commons
730:
708:
662:
624:
421:copyright status
407:copyright status
394:
389:
379:
376:
291:
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
738:
737:
733:
732:
731:
729:
728:
727:
696:
676:
668:
660:
616:
615:
612:
611:
610:
609:
608:
607:
606:
605:
603:
591:
590:
589:
587:
568:
567:
566:
565:
564:
563:
562:
561:
559:
549:
548:
547:
545:
530:
529:
528:
527:
526:
525:
524:
523:
521:
511:
510:
509:
507:
492:
491:
490:
489:
488:
487:
486:
485:
483:
471:
470:
469:
467:
448:
447:
446:
445:
444:
443:
442:
441:
439:
427:
426:
425:
423:
404:
403:
402:
401:
400:
399:
398:
397:
396:
395:
390:
387:
381:
380:
377:
374:
365:
364:
363:
361:
351:
350:
349:
347:
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:
736:
724:
723:
720:
716:
715:
712:
699:
695:
694:
689:
679:
674:
673:
670:
666:
663:
659:2,400 × 1,200
657:
652:
647:
643:
642:
639:
636:
633:
630:
627:
619:
604:
599:
597:
596:
595:
593:
592:
588:
585:source of file
583:
581:
580:
579:
578:
576:
572:
571:source of file
560:
557:
555:
554:
553:
551:
550:
546:
541:
539:
538:
537:
536:
534:
522:
519:
517:
516:
515:
513:
512:
508:
503:
501:
500:
499:
498:
496:
484:
479:
477:
476:
475:
473:
472:
468:
463:
461:
460:
459:
458:
456:
452:
440:
435:
433:
432:
431:
429:
428:
424:
419:
417:
416:
415:
414:
412:
408:
383:
382:
370:
369:
368:
367:
366:
362:
359:
357:
356:
355:
353:
352:
348:
343:
341:
340:
339:
338:
336:
332:
328:
324:
315:
310:
308:
305:
304:
303:
302:
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:
119:
118:
97:
87:
86:
40:
35:
34:
29:
24:
19:
9:
6:
4:
3:
2:
735:
721:
718:
717:
713:
710:
709:
706:
703:
693:
690:
688:
685:
684:
683:
669:
664:
658:
656:
653:
651:
648:
645:
644:
640:
637:
634:
631:
628:
626:
625:
623:
602:
598:
586:
582:
556:
544:
540:
520:15 April 2024
518:
506:
502:
482:
478:
466:
462:
438:
434:
422:
418:
393:
386:
373:
358:
346:
342:
313:
309:
306:
287:
280:
255:
252:
251:
249:
244:
241:
238:
235:
234:
232:
231:
227:
224:
212:
185:
182:
178:
172:
168:
164:15 April 2024
158:
152:
146:
141:
134:
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:
704:
701:
687:Log–log plot
681:
621:
618:File history
253:
242:
236:
149:
144:
114:You can help
104:
72:
22:File history
437:copyrighted
411:copyrighted
254:attribution
136:Description
678:File usage
635:Dimensions
543:media type
533:media type
360:some value
266:CC BY 4.0
27:File usage
722:47.24 dpc
714:47.24 dpc
667:Talgalili
632:Thumbnail
629:Date/Time
558:image/png
505:inception
495:inception
392:Talgalili
378:Talgalili
331:Talgalili
196:Licensing
184:Talgalili
145:English:
80:image/png
698:Metadata
661:(439 KB)
288:Captions
243:to remix
237:to share
228:license.
174:Own work
32:Metadata
646:current
641:Comment
345:creator
323:creator
312:depicts
292:English
128:Summary
76:
180:Author
170:Source
154:line.
638:User
275:true
272:true
160:Date
17:File
388::
375::
63:|
59:|
55:|
51:|
45:.
116:.
82:)
67:.