Announcement

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

  • Drawing a bar graph for routes codes

    Hello Stata users;

    I'm working with this data currently:
    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input int(Code_Ligne Distance)
    100 370
    101 370
    102 488
    103 404
    104 563
    105 270
    106 291
    107 323
    108 246
    109 172
    110 226
    113 246
    114 232
    115 207
    116 286
    117 520
    118 207
    119 172
    122 202
    123 212
    124 181
    125 177
    128 160
    129 165
    130 165
    131 157
    132 149
    133 181
    134 323
    135 286
    136 323
    138 172
    139 172
    141 232
    142 590
    143 465
    145 200
    146 471
    149 485
    151 181
    152 171
    153 171
    154 209
    155 160
    157 176
    162 397
    164 246
    167 323
    168 186
    169 202
    170 160
    171 160
    173 160
    174 227
    175 248
    176 214
    178 556
    179 696
    182 288
    183 465
    189 551
    192 232
    193 204
    194 605
    195 315
    204 200
    206 177
    207 299
    209 502
    216 422
    219 554
    300 160
    306 160
    320 115
    321 160
    501 487
    502 590
    503 563
    504 551
    506 509
    507 547
    508 333
    509 446
    510 452
    512 541
    517 606
    518 594
    end
    This is a data showing the distance covered by transport routes of a certain transport network. The first variable "Code_Ligne" is the code of the route, the seconde variable is its distance by Kms. As you can see, there is no routes codes with the number 400, the codes go from 321 to 500, that is because the transport company doesn't have routes that are coded 400. Yet, when I graw a bar graph showing the distance covered by each route, the x axis shows me routes which are coded 400, with no bars, since they don't exist in the data, and those take a space in the graph with no reason.
    What I wanna do is draw the bar graph, but only for the routes codes that exist on the data.

    Any help please? With thanks
Working...
X