Announcement

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

  • stripplot color

    Hi All,

    I think I am misreading the documentation for the (user written) stripplot function.


    I had been specifying the box option in accordance with the documentation (using the options of "twoway rbar" as suboptions) to create a blue box with a white outline. Following the documentation found under
    Code:
    help twoway rbar
    I used the following code:

    Code:
    *Draft Code
    sysuse auto
    stripplot price, box(fcolor("0 40 86") lcolor("255 255 255")) vertical over(foreign) ms(none) mlabpos(0)
    Instead of a white outline, it stuck with the default black. This didn't change when I replaced "255 255 255" with "white".

    On a hunch, I changed the "lcolor" option to "blcolor", since I noticed in the stripplot documentation it says
    "[t]he defaults are bfcolor(none) barwidth(0.4) blwidth(medthin)."
    So the code that did work was:

    Code:
    *Final Code
    sysuse auto
    stripplot price, box(bfcolor("0 40 86") blcolor("255 255 255")) vertical over(foreign) ms(none) mlabpos(0)
    My question is:
    (1) Is there more accurate documentation available than the "twoway rbar" options, which includes the options "blcolor()" and "bfcolor()"?
    (2) In the attached figure [the output of Final Code] there are thin lines that circumscribe the box and run through the white median lines. Is there a way to delete these?

    Kind regards,
    Dave
    Attached Files
    Last edited by David Dauria; 05 Jun 2019, 13:11.

  • #2
    stripplot is a command (not a function; in Stata function is not another name for command) from SSC (you're asked to explain provenance, so that people know where to get the files).

    stripplot has a long history going back to 1999, although it is still maintained.
    (I have a version of ado and help files on my computer later than the SSC version.)

    The current version is written for Stata 8.2, in a bid to accommodate users who are not able to afford an upgrade. The boxes in the box plot are drawn with a series of calls to rbar which call up bfcolor() and blcolor() options, which still work This is documented.

    As far as I can see the only thing wrong here is that people who don't know the old syntax might appreciate a little more explanation in the help that if they are familar with fcolor() and lcolor() they still need to use the old syntax. I will add some more detail to the next public release of the help. Thanks for the signal, which is helpful.

    The rest of your question appears to hinge on a desire to show a box plot with median and quartiles only. This was asked not long ago twice within one day:

    https://www.statalist.org/forums/for...median-and-iqr

    https://www.statalist.org/forums/for...-from-box-plot

    In short, if you want this, you can get it directly with graph box and graph hbox using an easy trick.

    I wrote up the answer as a Tip for the Stata Journal and it should appear in 19(3).
    Last edited by Nick Cox; 06 Jun 2019, 01:01.

    Comment

    Working...
    X