Announcement

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

  • Higher bar graph

    Hi there,

    I have made this code for a nice bar graph:

    Code:
    graph bar e45svenstrup e45vodskov e39bouet, over(stoppested, lab(angle(45)) sort(row)) bargap(-35) legend( label(1 "E45 Svenstrup") label(2 "E45 Vodskov") label(3 "E39 Bouet") rows(1) region(lstyle(none)) ) ytitle("Estimeret ÅDT [ktj]", margin(right)) xsize(10) graphregion(color(white))
    I like the design very much but there is something about the sizing. When I export the chart to PDF, the size is: [25,40 * 10,16 cm]. I want it to become higher without changing the width. How is that possible? I have tried ysize but that affects the width as well.

    Best Regards,
    Peter

  • #2
    You can specify ysize() xsize() and aspect().

    Comment


    • #3
      Thanks for your reply. I have now played around with these options but cannot figure out how to adjust the height without touching the width..

      Comment


      • #4
        Whenever that has happened to me it is because what I am also asking for has implications for the allowed width, as for example titles, axis details, or legends. I can't see your graph or your data, so I can't suggest more.

        Comment


        • #5
          Hi again,

          I have attached the data and the current graph based on this code:

          Code:
          graph bar frae45svenstrup frae45vodskov frae39bouet, over(stoppested, lab(angle(45)) sort(row)) bargap(-35) legend( label(1 "E45 Svenstrup") label(2 "E45 Vodskov") label(3 "E39 Bouet") rows(1) region(lstyle(none)) ) ytitle("Estimeret ÅDT [ktj]", margin(right)) xsize(10) graphregion(color(white))
          Attached Files

          Comment


          • #6
            Thanks for posting a data file. Here I give the data as we ask, using dataex (see FAQ Advice #12).

            It's hard to get that graph coming out well, as so much is being squeezed in. I suggest another approach, as below.

            Code:
            * Example generated by -dataex-. For more info, type help dataex
            clear
            input str24 stoppested float row int(frae45svenstrup frae45vodskov frae39bouet)
            "Ikea"                      1 212  71  83
            "Hjortevej"                 2 307 128 114
            "Bilka"                     3 296 162 155
            "Dyrskuevej"                4  45  36  39
            "Stationsmestervej"         5  25  11  16
            "Sofiendal skole"           6 200 112 111
            "Mariendal Mølle"          7 174  55  56
            "Firkløvervej"             8  35   7  10
            "Provstejorden"             9 112  24  26
            "Skipperen"                10  61  17  17
            "Sygehus Syd"              11 393 227 183
            "Aalborg Busterminal (B4)" 12 212 107  89
            "Boulevarden"              13 526 284 251
            "Nytorv"                   14  99  86  76
            "Jomfru Ane Gade"          15 255 211 173
            "Østerbrogade"            16 116 154  99
            "Zieglersvej"              17  24  22  17
            "Lerumbakken"              18  86  98  67
            "P. Larsens Vej"           19  10  11  12
            "Nr. Uttrup Torv"          20  97 217 149
            "Nr. Uttrup Kirke"         21  10   5   4
            "Ø. Fælledvej"           22  36  96 104
            "Brixlund"                 23  19   5   4
            "Virkelyst"                24  39  35  44
            "Gl. Høvej"               25  61  79  80
            "Bøgildsmindevej"         26  85 222 216
            "Kvickly"                  27   6   3   7
            end
            
            foreach v of var frae* {
                local label = proper(substr("`v'", 7, .))
                label var `v' "`label'"
            }
            
            graph dot (asis) frae*, over(stop, sort(row) label(labsize(small))) /// 
            marker(1, ms(Oh)) marker(2, ms(+)) marker(3, ms(Th)) ///
            linetype(line) lines(lc(gs12) lw(vthin)) ///
            legend(row(1) pos(12)) aspect(1.25)

            Click image for larger version

Name:	dotchart4.png
Views:	1
Size:	42.7 KB
ID:	1713430

            Comment


            • #7
              Hi Nick

              Thanks for your reply and for your help. For now I stick to current chart layout and the height of it.

              I will consider your suggested graph layout if the receiver of the report in making finds it difficult to read data from bar chart.

              Comment


              • #8
                Thanks for your comments.

                Comment

                Working...
                X