Announcement

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

  • Twoway marker size changing based on chart size specifications

    Using Stata 18.0

    I was generating some twoway graphs with specified aspect ratios using the aspectratio() option. After saving the graphs as .svg files, I noticed the aspect ratios of the set of graphs varied between two values despite identical aspectratio(). Axis labels were identical and the data were bounded within my specified axis labels [ylabel() and xlabel() options].

    Fed up, I switched from the aspectratio() option to using xsize() and ysize() options. For some reason, this changes the sizes of the markers and axis fonts when compared to the graphs generated with aspectratio().

    To replicate this:
    Code:
    sysuse auto
    twoway connected price rep78, msize(medium) mlwidth(none) aspectratio(2) plotregion(margin(zero) lwidth(none)) ylabel(0(5000)20000, angle(0))
    Code:
    twoway connected price rep78, msize(medium) mlwidth(none) xsize(1) ysize(1.5) plotregion(margin(zero) lwidth(none)) ylabel(0(5000)20000, angle(0))
    (I realize 1.5/1 does not equal 2, but these generate graphs of similar shape)

    Marker size can be varied by varying the xsize() and ysize() values and nothing else:

    Code:
    twoway connected price rep78, msize(medium) mlwidth(none) xsize(1) ysize(2) plotregion(margin(zero) lwidth(none)) ylabel(0(5000)20000, angle(0))
    Code:
    twoway connected price rep78, msize(medium) mlwidth(none) xsize(2) ysize(1) plotregion(margin(zero) lwidth(none)) ylabel(0(5000)20000, angle(0))
    What's going on here? Is the msize() option somehow linked to the area of the graph whitespace/background, which is changed by xaxis() and yaxis() but not aspectratio()?
Working...
X