Announcement

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

  • No of labels on axes of small multiples (scatter)

    I'm drawing a plot of multiple time series, each one starting at a different date and different durations. There are 15 series and the data is sorted by groupid and date. The stripped down command has the form:

    scatter y date , c(L) by(groupid, col(5) rescale) xlab(#4)

    I'm quite happy with the result except that some of the plots have 4 dates labelled, some 5, some 6 but one has only 2 (min and max). This does not seem to relate to the length of the series: a Jan21-Jul23 has 6 labels while Jul20-Apr22 has the 2.

    Changing to xlab(#5) causes the odd graph to have 8 labels, which is rather excessive!

    Any suggestions how I can tweak this to make the number more uniform? (Other than draw 15 graphs and combine them manually!)

    (Using Stata MP 16.1 for Windows Rev 13 Jun 2023)
    Last edited by R Allan Reese; 12 Mar 2026, 10:59.

  • #2
    If you're creating the scatter plots individually, you could try using

    Code:
    xlabel(minmax)
    or

    Code:
     xscale(range(1000 5000))
    I also recommend the help function in Stata using Scatter or axis_choice_options.

    Comment

    Working...
    X