Group Abstract Group Abstract

Message Boards Message Boards

1
|
2.9K Views
|
5 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Combined plots looking different from the individual ones?

Posted 5 years ago

Hello,

I am trying to combine two graphs that are identical in their formulas but slightly different with their parameters. Every time I try to combine them using "Show[ ]" the combined graph shows just two straight lines instead of showing the proper curves. Could it be a coding error? A size issue? I have no idea. I have attached the whole program below, plus screen shots of the specific areas and what the graphics look like.

Help is much appreciated Thank you.

Attachment

5 Replies
Posted 5 years ago

One option is to use the resource function CombinePlots. Will require some changes.

ktimepath1 =
  Plot[{Evaluate[k[t] /. solm]}, {t, 0, 200}, 
    PlotRange -> All, 
    AxesLabel -> {"t", "k"},
    PlotLegends -> {"k"},
    Frame -> True, 
    PlotStyle -> Thickness[0.01]] (* The two overlay exactly so increase thickness *)

ktimepath2 = 
  Plot[{Evaluate[k2[t] /. solm2]}, {t, 0, 200},
    PlotRange -> All, 
    AxesLabel -> {"t", "k2"},
    PlotLegends -> {"k2"}, Frame -> True, 
    FrameStyle -> Red,
    PlotStyle -> Red]

ResourceFunction["CombinePlots"][ktimepath1, ktimepath2, 
 "AxesSides" -> "TwoY",
 ImageSize -> 600]

enter image description here

POSTED BY: Rohit Namjoshi

Hey so I think your suggestion worked, however I just have an economics question about the graphs if you could maybe give your opinion.

Individually the time paths for each variable (h, k, y) have a logarithmic style graph from the beginning, but when I combined them using your suggestion using Resource Function, the time paths for h and k specifically look like the are exponential at first, then counter an inflection point after a certain point. Could this be because in the beginning of economic growth, there are positive returns to scale? It seems k and h do not possess diminishing returns in the beginning. Is that normal? Btw I am using the Mankiw Romer and Weil model of semi endogenous growth, and I am not sure if this is a phenomenon of the model, or an error in how I combined the two time paths. 

Interestingly, when I combine y (output) using your method, I do not see this which makes sense kind of? Sorry I know this is a little bit off topic, but I am just concerned that I combined the time paths in a way that messed up there individual time paths. Screenshot is below
Attachment

Attachments:

Thats great! however it looks like they're the same time path; one should be a bit different. Let me try what you sent me and see if I can make it work. Thank you sm!

Hi thanks for responding. How can I go about fixing it? All I want is to show the two time paths as they appear on their individual graphs but on one graph. I want to see both of them on the same time scales graph. They should look as they do (logarithmic shape) on the combined graph.

Posted 5 years ago
POSTED BY: Rohit Namjoshi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard