11/21/2023 0 Comments Add tag to xline stata![]() ![]() *A second, minor question is that I do not understand why the x-axis gets an elipsis (.) when I add the scatteri plot. I have tried adding axis(2) to the text box as an additional argument, but this option is apparently not allowed. It seems better to be able to attach the text to the line using the second y-axis gridpoints. Of course, I could manually determine this value for the histogram (as I did in this example), but I plan to create a set of these graphs via a loop, such that there are a dozen or so panels. ![]() The corresponding lines would instead be: text(1 `median' `"median = $`=string(`median',"%6.2f")'"', /// Instead of "0.08" which gets my text into the correct location, I would like to use "1", as this is the maximum value of the second y-axis. ![]() However, when I use xline (), the lines are always in the background. This is the reason I used the second y-axis in the first place. 1 Put xline in front of a histogram, 13:13 I have a histogram in Stata and want to plot two vertical lines in front of it. This produces the desired graph (for the most part*):Īt issue is that I do not know the height of the histogram beforehand. Scatteri 0 `median' 1 `median', recast(line) yaxis(2) /// coefplot looks for variables corresponding to the collected coefficient names and then uses their variable labels for the categorical axis. Twoway hist mpg, start(10) width(5) || /// Here is an example of my issue: sysuse auto However, I cannot seem to add text to this line using the second y-axis coordinates (it instead uses the first y-axis coordinates, even though the object it is labeling is on the second y-axis). To fix this, I am using scatteri with coordinates.īecause I do not know the height of the histogram beforehand, I set the scatteri plot to use a separate y-axis, which I have hidden. I cannot use xline() because the line falls behind the histogram, rather than on top of it. I have a plot of a histogram, to which I would like to add the median. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |