Announcement

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

  • graph hbar and graph combine

    Hello list users

    I am combining a number of horizontal bar charts (created using graph hbar) with graph combine. As bar labels can differ in length within and across graphs, this means that the y axes of the hbar charts do not align neatly under each other when graphs are stacked one above the other. I'm trying to see if there is a work around so that they do. Can the plot region be constrained to be of the same physical dimensions (and in the same place) within each graph? Or is it possible to fix the length of individual labels for categories? For example, I might define a yes/no label such as

    label define yn_lab 0 " Yes" 1 " No"
    label values x1 yn_lab

    However when plotted Stata strips out the leading spaces within the variable label yn_lab so that doesn't work.

    Thank you.




  • #2
    There are no precise examples here -- whether toy datasets, graphs, or complete code -- but one answer is not to use graph combine at all but recast your problem as one where a by() option will do all the work for you. Occasionally people are missing that a by() option is already available. Sometimes it takes a little more work to restructure the data first.

    I won't give examples as https://journals.sagepub.com/doi/10....36867X20976341 already discusses the point in detail, but if you supply more information, then code is more likely to ensue.

    Comment

    Working...
    X