Announcement

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

  • Twoway graph with different x-axes

    Dear users,
    I would like to know your opinion about an apparently simple question. I am not succeeding in saying Stata to use two different ranges and labels for the two graphs I am creating with the -twoway- command. More precisely, I am not able to set the second axis options.

    The code I am using is the following:

    Code:
    twoway scatter origin media , by(simpt) mcolor(emidblue) xaxis(1) xscale(range(4.6 5.2))  xaxis(2) xscale(range(6.0 7.0)) || rcap lower upper origin, horiz lcolor(emidblue) scheme(s1mono)
    the data:

    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input float(media lower upper) byte(origin simpt)
     4.09065 4.063758 4.117542 1 1
    4.056681 4.038801 4.074561 2 1
    4.000973 3.975708 4.026239 3 1
    5.066667 5.024275 5.109058 1 2
    5.025707 4.998073 5.053341 2 2
    4.939974 4.901125 4.978823 3 2
    end
    Do you have any clue? Thanks a lot, best, G.

  • #2
    I doubt that that's going to work even if you make it legal. This would be legal syntax (with the rest of the command):

    Code:
    xaxis(1 2) xscale(range(4.6 5.2) axis(1)) xscale(range(6.0 7.0) axis(2))
    Your second axis range includes none of the data, but Stata never omits data from a graph because of an axis scale option.



    Comment

    Working...
    X