Announcement

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

  • Changing the graph label while using the "catplot" command

    Hello!
    to make clear what my problem is I use the data "sysuse auto".
    To show you my problem I use two categorial variables, so I had to create one with the variable "price"
    I want to create a grouped bar chart with the command "Catplot", that works great too.
    But the labeling bothers me.
    I would like to remove the font "Car Type".
    How can I solve the problem?

    Syntax:

    generate price_exp= 0
    replace price_exp = 1 if price>5000
    generate price_low = 0
    replace price_low = 1 if price<4999

    generate price_kat =1 if price_exp==1
    replace price_kat =2 if price_low==1
    label variable price_kat "Price kategorial"
    label define price_label 1 "Teuer" 2 "Billig"
    label value price_kat price_label
    tab price_kat

    tab foreign price_kat, column
    catplot foreign, over(price_kat) percent(price_kat) asyvar recast(bar)
    Attached Files

  • #2
    Thanks for the data example.


    catplot is from SSC.

    What you need to know is documented in the help.


    Note: any categorical axis title that appears by default is produced by l1title() with hbar or dot
    or by b1title() with bar or the (otherwise undocumented) vertical option.


    so in your case to remove a title you don't want add the extra option


    Code:
    b1title("")

    Comment

    Working...
    X