Announcement

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

  • graph by()

    Hi everyone, sorry for the stupid question but I am not able to find a solution by myself. I want to plot an histogram by another variable. The problem is that the resulting graphs are a lot and when I export them only some of them have the yaxis. I tried by reducing the size of the graph but nothing changes.

    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input int(price mpg)
     4099 22
     4749 17
     3799 22
     4816 20
     7827 15
     5788 18
     4453 26
     5189 20
    10372 16
     4082 19
    11385 14
    14500 14
    15906 21
     3299 29
     5705 16
     4504 22
     5104 22
     3667 24
     3955 19
     3984 30
     4010 18
     5886 16
     6342 17
     4389 28
     4187 21
    11497 12
    13594 12
    13466 14
     3829 22
     5379 14
     6165 15
     4516 18
     6303 14
     3291 20
     8814 21
     5172 19
     4733 19
     4890 18
     4181 19
     4195 24
    10371 16
     4647 28
     4425 34
     4482 25
     6486 26
     4060 18
     5798 18
     4934 18
     5222 19
     4723 19
     4424 19
     4172 24
     9690 17
     6295 23
     9735 25
     6229 23
     4589 35
     5079 24
     8129 21
     4296 21
     5799 25
     4499 28
     3995 30
    12990 14
     3895 26
     3798 35
     5899 18
     3748 31
     5719 18
     7140 23
     5397 41
     4697 25
     6850 25
    11995 17
    end

    histrogram price, by(mpg)

    In this for example, only the latter five graphs have the y-axis. Is there any way to add the yaxis to the others? thank you.


  • #2
    Code:
    hist price, by(mpg, iyaxes)

    Comment


    • #3
      Actually it does not work too

      Comment


      • #4
        what do you mean does not work? is this closer to what you want,
        Code:
        hist price, by(mpg, iyaxes) ylabel(,format(%9.4g) angle(0))
        ?

        Comment


        • #5
          How many histograms are we talking about? More about 25? You could fall back on graph combine but then the fraction of space that isn't showing data will go up yet more.

          It's not so much a case of quite what syntax you might use as a case of is this graph really going to help anybody and would a different way to show the data work better?

          Comment

          Working...
          X