![]() If this were not specified, as in the plot for y = x^2, the plot will be connected by 300 (the default) markers - ugly. ![]() What is "n(#)" for? This tells Stata to draw the plot at 20 points. In our case, we specified that the new plot type is a connected graph, for which you can specify marker symbols. The recast option will tell Stata to treat the plot as a new plot. Tw function y = x^2, range(-2 2) recast(connected) msymbol(O) || ///įunction y = x^3, range(-2 2) recast(connected) msymbol(T) n(20) || ///įunction y = x^4, range(-2 2) recast(connected) msymbol(S) n(20) /// For example:įunction y = x^3, range(-2 2) lpattern(-) || ///įunction y = x^4, range(-2 2) lpattern(.-) ///Ĭols(3) pos(5) ring(0) region(lcolor(none)))īut suppose you prefer to use marker symbols rather than line patterns to differentiate the line plots, how can you specify this option? Use the recast option (-help advanced_options-): These options are particularly helpful when you have many functions to plot. Tw function y = 4*x^2, range(-2 2) lcolor(red) lwidth(medthick) lpattern(-) ![]() For example, if you want to change the color, width, and pattern of the line use lcolor, lwidth, and lpattern options: It is easy to change the line attributes of the plot. If you want to draw the other side of the parabola or change the range, you can specify the range as follows: The default is that the function is drawn over the range. For example, the half of a parabola with the equation y = x^2 can be drawn by typing: 0967388 Kurtosis 2.395841Edit: after quite a while, did I notice Friedrich' suggestion on a similar verge, i.e, to - reshape long - as well.Stata's -graph twoway function- draws the line plot of a specified function. 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. 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. Xsize(10) ysize(20) xlabel(#10) ylabel(1(4)14, labsize() tlength(zero) glwidth(vvvthin) glstyle(dot) glcolor(black)) ytick(none) ymlabel(none) 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. ![]() 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.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |