Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6892065
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:29:17+00:00 2026-05-27T06:29:17+00:00

To create my dotplot I am using the following text file: ## filename difference

  • 0

To create my dotplot I am using the following text file:

 ## filename  difference    RMSD
    1bso.pdb         1.0  0.5645
 1cj51.9.pdb         2.0  3.5596
 1cj51.1.pdb         3.0  3.5573
    3qzj.pdb         3.0  0.8302
    1bsy.pdb         4.0  0.5387
 1cj51.5.pdb         8.0  3.9864
    2gj5.pdb        10.0  0.8446
1cj51.10.pdb        11.0  3.5914
    1uz2.pdb        12.0  1.7741
    2blg.pdb        12.0  0.5449

The 1st column is the file name, second column in the difference and the 3rd is the RMSD. The data was ordered so the difference is ascending.

I can create individual dot plots using the following commands:

# This plots the difference
library(lattice)
data <- read.table("~/Documents/Beta_test_area/pa.txt", header=F, sep="\t")
dotplot(V1~V2, xlim=c(0, 150), xlab="CCS Difference", data=data)

# This plots the RMSD
dotplot(V1~V3, xlim=c(0, 5), xlab="RMSD", data=data)

On the graph the data on the Y axis is ordered by file name and the data is not plotted as in the text file, how can I order the Y axis to mirror the order in the data file?

The other problem I am having is combining the plots. How can I have the make the plots so that I have the plots in one row but over two columns. With the difference plot on the left and the RMSD plot on the right.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T06:29:17+00:00Added an answer on May 27, 2026 at 6:29 am

    @Roman’s part #1 is correct — here’s a slightly slick way to get the order the way you want it.

    dat <- read.table(textConnection("
    filename    diff RMSD
    1bso.pdb    1.0 0.5645
    1cj51.9.pdb 2.0 3.5596
    1cj51.1.pdb 3.0 3.5573
    3qzj.pdb    3.0 0.8302
    1bsy.pdb    4.0 0.5387
    1cj51.5.pdb 8.0 3.9864
    2gj5.pdb    10.0    0.8446
    1cj51.10.pdb    11.0    3.5914
    1uz2.pdb    12.0    1.7741
    2blg.pdb    12.0    0.5449"),
               header=TRUE)
    dat <- transform(dat,filename=factor(as.character(filename),
                           levels=filename))
    

    The grid.arrange function from the gridExtra package is handy for arranging lattice plots:

    library(lattice)
    d1 <- dotplot(filename~diff, xlim=c(0, 150), xlab="CCS Difference", data=dat)
    
    # This plots the RMSD
    d2 <- dotplot(filename~RMSD, xlim=c(0, 5), xlab="RMSD", data=dat)
    
    library(gridExtra)
    grid.arrange(d1,d2,nrow=1)
    

    Or (from @Aaron):

    library(latticeExtra)
    c(d1,d2)
    

    Alternatively as @Roman suggested you can create small multiples.

    library(reshape)
    m <- melt(dat)
    dotplot(filename~value|variable,
           scales=list(x=list(relation="free")), xlim=list(c(0,150), c(0,5)),
           data=m)
    

    Or

    library(ggplot2)
    g1 <- qplot(value,filename,data=m)+
      facet_grid(.~variable,scale="free")+theme_bw()+
      opts(panel.margin=unit(0,"lines"))
    

    although here I really don’t know how to set the x axis limits panel-by-panel, other than doing something nasty like trying to add invisible points appropriately.

    edit: panel-by-panel scaling from Josh O’Brien, latticeExtra from Aaron

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Create a flat text file in c++ around 50 - 100 MB with the
Create a file called Valid[File].txt and stick some text in it. Start powershell and
CREATE INDEX alias_pub_idx2 ON info.palias USING btree (publisher_id, player_id, pub_player_id); CREATE INDEX alias_pub_idx3 ON
I am making a dotplot using ggplot with the code and data that is
CREATE TABLE item ( link MEDIUMINT UNSIGNED PRIMARY KEY NOT NULL, title TEXT NOT
CREATE FUNCTION testing(id INT, dsc TEXT) RETURNS TEXT BEGIN DECLARE ntxt TEXT; SET ntxt
Is it possible to create a dotplot - dotchart() - in R with a
CREATE DATABASE [JKamdar_Soft] ON PRIMARY ( NAME = N'JKamdar_Soft', FILENAME = N'C:\Program Files\Microsoft SQL
CREATE TABLE DIALOGUE_TABLE(EXPIRE_TIME TIMESTAMP); Following code snippet is inside stored proc : PO_EXPIRETIME :-
create table person ( name varchar(15), attr1 varchar(15), attr2 varchar(1), attr3 char(1), attr4 int

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.