Announcement

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

  • Change color of boxplots (without asyvars) by keeping xlabels

    Hello Statalisters,

    I am generating boxplots and trying to have different colors. When using "asyvars" option, this does the trick, however, asyvars also automatically erases the labels of boxes on x-axis and generates the legend, which I do not want.

    My purpose is to have boxes of different colors by keeping the x-axis label.

    I have tried the following :

    Code:
    sysuse auto
    graph box price, over(foreign) box(2,color(red))
    
    /*
    graph box price, over(foreign) box(2,color(red)) asyvars
    *This does the trick but a legend is generated and I cannot add new labels on x axis for the boxes
    
    
    */
    I have checked the help and previous posts, but failed to find a solution to this problem. I thought that maybe "xlabel()" would be a solution, but apparently x*() options are inactive for boxplots.

    Thank you for your kind help

  • #2
    Code:
    graph box price, over(foreign) box(2,color(red)) asyvars showyvars leg(off)

    Comment


    • #3
      That's exactly what I needed, thanks Andrew!

      Comment


      • #4
        That worked well for me! Thanks Andrew

        Comment

        Working...
        X