-1
$\begingroup$
roots = NSolve[Sin[2z] == Cos[Sin[z]] + 1 && -2π <= Re[z] <= 2π && -2π <= Im[z] <= 2π, z]; 
w = z\.roots;    
ListPlot[{Re[w], Im[w]}, Ticks -> {{-2π, -π, 0, π, 2π}, {-2π, -π, 0, π, 2π}}]

In this code, Ticks command is not working properly, that is, real axis range is not showing between $-2\pi$ to $2\pi$, where as imaginary axis is showing properly.

Also, is there any command for complex list plot and complex plot? I mean a command such that the following command works

ComplexListPlot[w, Ticks -> {{-2π, -π, 0, π, 2π}, {-2π, -π, 0, π, 2π}}]

instead of

ListPlot[{Re[w], Im[w]}, Ticks -> {{-2π, -π, 0, π, 2π}, {-2π, -π, 0, π, 2π}}]
$\endgroup$
1
$\begingroup$

How about this

 roots = Values@
       NSolve[Sin[2 z] == Cos[Sin[z]] + 1 && -2 π <= Re[z] <= 
          2 π && -2 π <= Im[z] <= 2 π, z];

    pts = Join @@ ReIm[roots];

    ListPlot[pts, PlotRange -> {{-2 π, 2 π}, Automatic},
Ticks -> {{-2 π, -π, 0, π, 2 π}, {-2 π, -π,  0, π, 2 π}}]

enter image description here

$\endgroup$
1
$\begingroup$
ListPlot[ReIm[w], 
 Ticks -> {{-2 π, -π, 0, π, 2 π}, {-2 π, -π, 0, π, 2 π}}, 
 PlotRangePadding -> Scaled[.1]]

enter image description here

You can also use Transpose[{Re[w], Im[w]}] in place of ReIm[w].

$\endgroup$
1
$\begingroup$

Take a look at the structure of {Re[w], Im[w]}:

{{-5.44099, -5.44099, -5.38849, -5.38849, -5.18796, -5.18796, <<517>>}, 
 {-2.83853, 2.83853, 0.561567, -0.561567, -3.38889, 3.38889, <<517>>}}

These are two long lists: all the real parts, followed by all the imaginary parts. This is not a list of pairs, as desirable to obtain your plot. You should Transpose that list to obtain what you want:

Transpose@{Re[w], Im[w]}

(* Out 
{{-5.44099, -2.83853}, {-5.44099, 2.83853}, {-5.38849, 0.561567}, {-5.38849, -0.561567}, <<519>>}
*)

So this would work:

ListPlot[Transpose@{Re[w], Im[w]}, Ticks -> {{-2 π, -π, 0, π, 2 π}, {-2 π, -π, 0, π, 2 π}]

A better alternative, however, is to use the built-in ReIm, which is listable, so it will automatically thread over your list of complex and give you the format you need:

ReIm[w] == Transpose@{Re[w], Im[w]}
(* Out: True *)
$\endgroup$

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.