Announcement

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

  • Produce a line graph with no xlabel and x minor ticks

    Dear all,

    I am trying to produce a graph with major and minor ticks on the x-axis but no labels on this axis (this will be used to combine with other graphs). My command looks like this:

    line cum_del_GBS_05 cum_del_GBS_10 delay_sys_week if n_records_allr<=100&delay_sys<=182, ///
    xlabel(none) xtick(0 (5) 25) xmtick(##5) xtitle(" ", margin(small)) ylabel(0 (0.2) 1) ///
    ytitle("Cumulative proportion", margin(small)) title("GBS") ///
    legend(label(1 "2005-2009") label(2 "2010-2015"))

    When I run it I get the graph attached - no label, major ticks but no minor ticks. I have tried to go through the help but I can't really understand why this is happening. Is there any way to get around this?

    Thanks in advance.

    Kind regards,
    Andreia Leite

  • #2
    I'd guess that Stata's guess at where the minor ticks should go is exactly where you have major ticks, So they are there, but occluded by your major ticks.

    Please follow http://www.statalist.org/forums/help#stata on photo attachments, i.e, don't include them, but do include a .png attachment

    Comment


    • #3
      You are requesting the same number of minor ticks as there are major ticks at first glance. For the minor ticks, try using a similar range specifier like:

      Code:
      line cum_del_GBS_05 cum_del_GBS_10 delay_sys_week if n_records_allr<=100&delay_sys<=182, ///
      xlabel(none) xtick(0 (5) 25) xmtick(0(1)25) xtitle(" ", margin(small)) ylabel(0 (0.2) 1) ///
      ytitle("Cumulative proportion", margin(small)) title("GBS") ///
      legend(label(1 "2005-2009") label(2 "2010-2015"))
      If there are the same number of major and minor ticks they'll overlap in a way that you won't necessarily be able to see easily.

      Comment


      • #4
        Many thanks for your replies (it worked just fine with the new range specifier) and I am sorry about the photo.

        Comment

        Working...
        X