Announcement

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

  • Boxplots do not appear as expected

    Dear All,

    I am using Stata IC 14.2 (64-bit).

    I am developing boxplots (sorted by a nominal variable: n200_cab_blind). Some of the boxes appear different (lighter in color) than the rest. There is no part of my code that dictates that difference in color. The boxes that are affected are always on the right-hand side of my graphs.

    I have included the graph, as well as the code that I use.

    Code:
    egen median= median(bladderlowcoretemp), by(n200_cab)
    
    sum bladderlowcoretemp, det
    
    di r(p50)
    
    local x=r(p50)
    
    local x: di %9.1f `x'
    
    graph box bladderlowcoretemp if bladderlowcoretemp~=., yline(`r(p50)') ylabel(, angle(0)) over(n200_cab_blind, label(angle(rvertical) labsize(small)) sort(median)) nooutsides ytitle("Temperature, degrees") title ("Lowest Core Temp (C) by Center") note("Isolated CAB" "Only Includes Cases Matched to Surgical Records" "Site for Core Temp was Bladder" "Red line:median value across the database is:`x' degrees")
    
    graph export "Blinded\Temperature Management\lowesttemp_isolcabg.wmf", replace
    I appreciate help from the group.
    Attached Files

  • #2
    Without your data, I tried an example with 40 groups and could not see a problem.

    Code:
    clear
    set obs 400
    egen group = seq(), block(10)
    set seed 2803
    gen y = rnormal()
    graph box y, over(group)
    I would try other file formats. I have never used .wmf, but .png always works well for me.

    Incidentally, a degree symbol can be called up with {&degree} in a title option.

    Comment


    • #3
      Just to add: I do get similarly funny results with .wmf, but no issues when exporting to png or tiff

      Comment


      • #4
        switching to the .png helps to solve the problem, albeit the quality of the figures are now reduced. Jorrit, would you advise to you the .tiff instead?

        Comment

        Working...
        X