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

  • SEARCH
  • Home
  • 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 7572429
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T15:55:23+00:00 2026-05-30T15:55:23+00:00

I am drawing dotplot() using lattice or Dotplot() using Hmisc . When I use

  • 0

I am drawing dotplot() using lattice or Dotplot() using Hmisc. When I use default parameters, I can plot error bars without small vertical endings

–o–

but I would like to get

|–o–|

I know I can get

|–o–|

when I use centipede.plot() from plotrix or segplot() from latticeExtra, but those solutions don’t give me such nice conditioning options as Dotplot(). I was trying to play with par.settings of plot.line, which works well for changing error bar line color, width, etc., but so far I’ve been unsuccessful in adding the vertical endings:

require(Hmisc)
mean = c(1:5)
lo = mean-0.2
up = mean+0.2
d = data.frame (name = c("a","b","c","d","e"), mean, lo, up)
Dotplot(name ~ Cbind(mean,lo,up),data=d,ylab="",xlab="",col=1,cex=1,
        par.settings = list(plot.line=list(col=1),
                       layout.heights=list(bottom.padding=20,top.padding=20)))

enter image description here

Please, don’t give me solutions that use ggplot2…

  • 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-30T15:55:25+00:00Added an answer on May 30, 2026 at 3:55 pm

    I’ve had this same need in the past, with barchart() instead of with Dotplot().

    My solution then was to create a customized panel function that: (1) first executes the original panel function ; and (2) then uses panel.arrows() to add the error bar (using a two-headed arrow, in which the edges of the head form a 90 degree angle with the shaft).

    Here’s what that might look like with Dotplot():

    # Create the customized panel function
    mypanel.Dotplot <- function(x, y, ...) {
        panel.Dotplot(x,y,...)
            tips <- attr(x, "other")
            panel.arrows(x0 = tips[,1], y0 = y, 
                         x1 = tips[,2], y1 = y, 
                         length = 0.15, unit = "native",
                         angle = 90, code = 3)
    }
    
    # Use almost the same call as before, replacing the default panel function 
    # with your customized function.
    Dotplot(name ~ Cbind(mean,lo,up),data=d,ylab="",xlab="",col=1,cex=1,
            panel = mypanel.Dotplot,
            par.settings = list(plot.line=list(col=1),
                           layout.heights=list(bottom.padding=20,top.padding=20)))
    

    enter image description here

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

Sidebar

Related Questions

I'm using System.Drawing.Color, is there anything in Visual Studio that can display the color
I'm working on drawing an SVG grid using Javascript. I've managed to get the
I'm doing custom drawing in datagridview cells and I have items that can vertically
I'm drawing rectangles on the screen using the basic NSBezierPath method. I have an
I'm drawing an image to a canvas (using the cityTexture method in http://haldean.github.com/citycanvas/city.js )
When drawing an editable Polygon on a map using Google's V3 API, is there
On drawing on canvas if i use this code to draw the bitmap then
I am currently drawing a Bitmap to a SurfaceView using Canvas.drawBitmap() . This seems
I am drawing some points in an array using glVertex2f(), and I need to
I'm drawing a flat disk using gluDisk() in my scene. gluDisk() draws the disk

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.