Announcement

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

  • Changing axis labels using mrgraph command (mrtab module)

    I have been using the mrgraph command from the mrtab module to help deal with multiple response questions in survey data.

    The command is very useful in counting multiple responses quickly but aesthetically it does not look great - namely the font size of the variable labels on the x-axis (or y-axis if using graph hbar).

    Code:
     mrgraph hbar B2_1 B2_2 B2_3 B2_4 B2_5 B2_6 B2_7 B2_8 B2_9 B2_10, r(1 2 3 4 5 6 7 8 9 10) blabel(bar) width(30) bar(1, color("23 55 94")) graphregion(color(white)) title("What are the matters of" "local importance?") sort(1) descending
    This code provides the following bar graph:
    Click image for larger version

Name:	B2.png
Views:	1
Size:	53.6 KB
ID:	1514121


    I would like the text on the y-axis to be smaller so that it does not take up so much of the graph space (this is a larger issue for other questions where responses were a lot longer).

    If anyone has any experience using mrgraph or anything similar then any help would be hugely appreciated.
    Last edited by Lawrence Symonds; 28 Aug 2019, 09:05.

  • #2
    The latest version of the mrtab code is from SSC, as you are asked to explain (FAQ Advice #12).

    From the help it follows that adding an option something like

    Code:
    oversubopts(label(labsize(small)))
    should help. Necessarily I can't test on your dataset, as you don't give a data example. I'd also reduce the use of upper case and seek to abbreviate some category names.

    Comment


    • #3
      That's great, thanks!

      Thanks for your advice as well.

      Comment


      • #4
        Thanks, Nick for this. I was actually searching for the same type of solution. It was really helpful. But I have a linking question to that- In the above graph, Is it possible to produce the bars are in separate colors? If possible, how can I get bars for separate color?

        Comment

        Working...
        X