0
$\begingroup$

I would like to reproduce the plot shown in fig(b) from the link.

enter image description here

How can I obtain yellow, red, green and blue using the command? Let's say there are 4 roots in total. In this case roots will be {2, 1 + i,1 - i, -3 }. I'm trying plot something like in figure (b) of the above link by using the codes in a similar post.

List @@@ Table[ColorData[45, k], {k, 1, Length[roots]}];

Thanks, RM

$\endgroup$
9
  • $\begingroup$ Welcome to the Mathematica Stack Exchange. I am afraid your question is not quite clear to me at the moment. Specifically, why would you want to "obtain" the four colors when you already have them? $\endgroup$
    – Syed
    Commented Mar 11, 2022 at 19:10
  • $\begingroup$ I'm trying to obtain something like figure (b) in hindawi.com/journals/jam/2014/539707/fig16 and I don't understand how command "ColorData" works... $\endgroup$ Commented Mar 11, 2022 at 19:14
  • $\begingroup$ roots is left undefined $\endgroup$
    – user49048
    Commented Mar 11, 2022 at 19:20
  • $\begingroup$ Yes, but roots will be finite distinct numbers (for instance, four numbers). $\endgroup$ Commented Mar 11, 2022 at 19:21
  • $\begingroup$ Yes, but it makes a difference. For instance if roots = {{1, 2, 3, 4, 5, 6}} then Length[roots] is 6. On the other hand, if roots = {{1, 2, 3, 4, 5, 6}, {1, 2, 3, 4, 5, 6}} then Length[roots] is 2. On top of that, different numbers will result in different plots. $\endgroup$
    – user49048
    Commented Mar 11, 2022 at 19:23

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.