Seqanswers Leaderboard Ad

Collapse

Announcement

Collapse
No announcement yet.
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • plotting 5 million points in R

    I plotted 5 million points in R. Is there a way to clean this up? Make it easier to spot patterns?


  • #2
    I'd like to reproduce this but don't know how:

    Comment


    • #3
      I would recommend using something like geom_tile() or geom_raster() in ggplot2 rather than plotting the actual points. That will make it vastly simpler to spot trends.

      Comment


      • #4
        geom_raster looks really nice!

        Unfortunately I only have 2 data columns. Looks like geom_raster requires 3 columns? the faithfuld plot used in the example link below has 3 columns in it,

        1) waiting
        2) eruptions
        3) density

        all 3 are used to create the plot. Can you apply this to 2 column data?

        Comment


        • #5
          Ah, right, try geom_density_2d() instead.

          Comment


          • #6
            Thanks for the tip, but now I'm having the opposite problem. The plots are too spars. Either the whole plot is colored or almost nothing at all. :-p

            Comment


            • #7
              Maybe this is too obvious, but have you tried randomly subsampling?

              Comment


              • #8
                That worked.... thanks! duh... :-)

                I read threads of people plotting millions of datapoints so I just assumed R could handle it easily. Looks like 100k to 1 M is the perfect range for pch='.'

                Comment


                • #9
                  You can also use smoothscatter, which plots a smoothed contour plus points for any outliers

                  Comment


                  • #10
                    If you want to plot the actual points, play with alpha (transparancy) using one of the solid shapes (15-20). R can certainly handle it just be aware that the file will be huge.
                    Microbial ecologist, running a sequencing core. I have lots of strong opinions on how to survey communities, pretty sure some are even correct.

                    Comment


                    • #11
                      Originally posted by thermophile View Post
                      R can certainly handle it just be aware that the file will be huge.
                      If you output a PNG file rather than an SVG or PDF file, then the output file will not be huge. It just won't have as much information in it, and won't be infinitely scalable.

                      Comment

                      Latest Articles

                      Collapse

                      • seqadmin
                        Current Approaches to Protein Sequencing
                        by seqadmin


                        Proteins are often described as the workhorses of the cell, and identifying their sequences is key to understanding their role in biological processes and disease. Currently, the most common technique used to determine protein sequences is mass spectrometry. While still a valuable tool, mass spectrometry faces several limitations and requires a highly experienced scientist familiar with the equipment to operate it. Additionally, other proteomic methods, like affinity assays, are constrained...
                        04-04-2024, 04:25 PM
                      • seqadmin
                        Strategies for Sequencing Challenging Samples
                        by seqadmin


                        Despite advancements in sequencing platforms and related sample preparation technologies, certain sample types continue to present significant challenges that can compromise sequencing results. Pedro Echave, Senior Manager of the Global Business Segment at Revvity, explained that the success of a sequencing experiment ultimately depends on the amount and integrity of the nucleic acid template (RNA or DNA) obtained from a sample. “The better the quality of the nucleic acid isolated...
                        03-22-2024, 06:39 AM

                      ad_right_rmr

                      Collapse

                      News

                      Collapse

                      Topics Statistics Last Post
                      Started by seqadmin, 04-11-2024, 12:08 PM
                      0 responses
                      18 views
                      0 likes
                      Last Post seqadmin  
                      Started by seqadmin, 04-10-2024, 10:19 PM
                      0 responses
                      22 views
                      0 likes
                      Last Post seqadmin  
                      Started by seqadmin, 04-10-2024, 09:21 AM
                      0 responses
                      16 views
                      0 likes
                      Last Post seqadmin  
                      Started by seqadmin, 04-04-2024, 09:00 AM
                      0 responses
                      47 views
                      0 likes
                      Last Post seqadmin  
                      Working...
                      X