# Plotting the results of a system of equations

I believe this is a question of more list manipulation than plotting, but I hope you could help me. I solve numerically a system of equations of 3 variables, take only real solutions where one of the parameters is within the unit circle and evaluate its stability for different cost parameter C as

costValues = {};
solutionValues = {};
stabilityValues = {};
Do[
(*real steady state solutions where m is within the unit circle*)
ssOut = Select[NSolve[{x == xEq, p == pEq, m == mEq} /.{C -> costVal}, {x, p, m}],
Element[{x, p, m} /. #, Reals] && 0 < ({x, p, m} /. #)[[3]] < 1 &];
(*calculate eigenvalues for the Jacobian for each solution*)
eigenValues = Table[N[Eigenvalues[jacobian /. {C -> costVal} /.solution]], {solution, ssOut}];
(*check how many eigenvalues are within the unit circle*)
stability = Table[Length[Cases[eigenValue, x_ /; -1 < Re[x] < 1]], {eigenValue,  eigenValues}];
(* append the results to the lists *)
AppendTo[costValues, costVal];
AppendTo[solutionValues, ssOut];
AppendTo[stabValues, stability];
, {costVal, 0, 1}]


My result lists look the following

costVals= {0., 1};
solutionValues= {{}, {{x -> 28.8952, p -> 0.059159, m -> 0.010203}, {x -> -28.8946,
p -> -0.0577157, m -> 0.010203}, {x -> 28.8886, p -> 0.0432996,
m -> 0.010203}, {x -> -28.888, p -> -0.0418563, m -> 0.010203}}};
stabValues= {{}, {3, 2, 1, 1}};


Of course, there could be many more costVar values. The point is, that for each costVar value I could have a number of solutions with different stability values.

I would like to plot on separate diagrams different solution values x, p and m against the costValues and with a condition that if a stabValue is equal 2 the color should be green (stable) and if not then it should be red (unstable). So for example above, on horizontal axis I would like to have values 0 and 1 and on vertical axix for instance for variable x I would like to 0 points for costVal=0 and 4 points for costVal=1 where the second solution should be marked green and the other red. I spent a couple of days on that without a success, do you have any idea how to do that efficiently?

listx = {};
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.35344353318214417, "perplexity": 2580.8338714957026}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-51/segments/1575540529516.84/warc/CC-MAIN-20191210233444-20191211021444-00192.warc.gz"}