![]() 0967388 Kurtosis 2.395841Edit: after quite a while, did I notice Friedrich' suggestion on a similar verge, i.e, to - reshape long - as well. reshape long headline underlying, i(id) j(phase) And for the pair of lines for each country, I want red for headline inflation, and blue for underlying, so that they can be distinguished. The horizontal line is obscured by the shading because the shading is created first, but I need the shading to be created first because otherwise, it obscures the plot of the time series (since Stata doesn't support transparency/alpha blending). I already transformed the inflation rates for each country such that for country A, value 1 correspond 0% inflation rate, for country B value 2 correspond to 0% inflation rate, so that the lines for country A will fluctuate around 1, and those for country B around 2, country C around 3, etc. I want to plot on the same graph both types of inflation for a number of countries. ![]() My question is, given the limit on number of arguments, is there a way to assign one color to lines of Set1 and another color to lines of Set2.įor illustration, the Set1* lines are headline inflation, and Set2* lines are underlying inflation. However I am unsure how to label these xlines. Multiplying by a number greater than 1 makes the color stand out from the background more multiplying by a number less than 1 makes the color blend into the. Xsize(10) ysize(20) xlabel(#10) ylabel(1(4)14, labsize() tlength(zero) glwidth(vvvthin) glstyle(dot) glcolor(black)) ytick(none) ymlabel(none) 1 Labelling 'xline', 02:50 Hello all, I have a CDF with a few 'xlines'. To specify a color and modify its intensity (brightness), you might specify things such as green.8 red1 purple1.2 0 255 255.8 Multiplying a color by 1 leaves the color unchanged. Subtitle(,size(small)) tlabel(,format(%tCHH) labsize(vsmall)) legend(off) ytitle("") xtitle("") title("") /// Lcolor (red red red red red red red red red red red red red red blue blue blue blue blue blue ) /// Graph twoway tsline Set1A Set1B Set1C Set1* Set2A Set2B Set2C Set2*, /// You might look into "pstyles".Thanks Doug. Heres the code Ive tried: > twoway (line var1 year, xline(1980 1992 1996)), by(var2. (If so, please report back here!) And then, you should have what you need for your actual application.Īdded in edit - the author's original Stata Journal article is available for free download at and perhaps among the extensive writeup there will be found some relevant examples.It would help to have the code you are starting from, to better understand the organization of the data you are starting from, and the graph you hope to end up with. color in a twowar graph > with the by option. If not, perhaps you can alter the second two examples to produce success. barplot( ElementContainingData ) abline( h AxisInterceptValue, col Color) Example: > barplot(. Perhaps the first two examples suffice for you. The line color can be customized using the col argument. color legendline legend outline color xyline added line color Examples. ![]() Then the vertical line can just be a grid line associated with the axis label. tsline kstock if company 1, xaxis (1 2) xla (1940 'start', axis (2) grid glcolor (red)) xtitle ('', axis (2)) So, you must declare that you want two x axes. Or, possibly, the options need to be placed differently, although I admit the section of the help titled "Placement of options" did not reveal to me the problem with my naive code.īut for me this would all now be trial and error. It's at the top of the line, which seems the essence here. To include the indicator line we use the the option xline(). For g3 and g4, though, the graph combine that is obviously used to produce the array of plots does not seem to notice the options. Line plots can be generated using Statas twoway command we saw earlier. Because 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. To fix this, I am using scatteri with coordinates. I cannot use xline() because the line falls behind the histogram, rather than on top of it. The results were as I hoped for g1 and g2. I have a plot of a histogram, to which I would like to add the median. Regress price mpg headroom trunk length turn if foreign=1Ĭoefplot domestic foreign, drop(_cons) xline(0) graphregion(color(white)) bgcolor(white) name(g2)Ĭoefplot domestic || foreign, drop(_cons) xline(0) graphregion(color(white)) bgcolor(white) name(g3)Ĭoefplot domestic || foreign, yline(0) bycoefs vertical byopts(yrescale) graphregion(color(white)) bgcolor(white) name(g4)Copy this into your do-file editor and run it. Regress price mpg headroom trunk length turn if foreign=0 Regress price mpg headroom trunk length turnĬoefplot, drop(_cons) xline(0) graphregion(color(white)) bgcolor(white) name(g1) ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |