1
$\begingroup$

I had a set of data a5 that had imaginary values but when plotted, that data doesn't shows on the graph.

ClearAll[a5,n1]
a5 = {{0.82, 2460}, {1.64, 566}, {1.76,
 485}, {1.95, 385}, {2.06, 339}, {2.24, 274}, {2.47, 214}, {2.74, 
159}, {3.09, 107}, {3.53, 55.9}, {3.80, 21.9}, {3.84, 
15.25}, {3.87, 2.61}, {4.12, 0. + 36*I}, {4.59, 0. + 52*I}, {4.94,
 0. + 55*I}, {5.26, 0. + 56.6*I}, {5.62, 0. + 56.75*I}, {5.83, 
0. + 56.42*I}, {6.18, 0. + 55.48*I}, {6.51, 0. + 54.34*I}, {6.87, 
0. + 52.91*I}};
n1 = ListLinePlot[a5, PlotRange -> {{0, 7}, {0, 1350}}]

I got the plot as shown below where i am missing all the data for x>3.87. How could i get the graph for all the values inside the dataset a5.

enter image description here

$\endgroup$
  • $\begingroup$ Where should e.g. {4.12, 0. + 36*I} appear? $\endgroup$ – Kuba May 18 '18 at 21:42
  • $\begingroup$ @Kuba , First time I m plotting the imaginary values. So don’t know the value like as 0. + 36*I appears or not? $\endgroup$ – rabink May 18 '18 at 22:04
  • 1
    $\begingroup$ Sorry, don't know what do you mean. {4.12, 0. + 36 I} does not belong to R x R space. You may want to use Re Im, Abs or Arg etc to convert complex numbers to real, whether that makes sense with your data is impossible to tell without background. $\endgroup$ – Kuba May 18 '18 at 22:16
2
$\begingroup$
   ListPlot[{Re[#], Im[#]} & /@ a5, PlotRange -> All, AspectRatio -> 1/2,
       Frame -> True, FrameLabel -> {{Im, None}, {Re, "complex plane"}}, 
        PlotStyle -> {Blue, Red}, 
        PlotMarkers -> {{"\[FilledCircle]", 15}, {"\[EmptyCircle]", 15}}, 
  PlotLegends -> PointLegend[{"Re", "Im"}, LegendMarkers ->   Automatic],
   FrameStyle -> Directive[Black, Thick], 
   LabelStyle -> Directive[Bold, Medium]]

plot

$\endgroup$
  • $\begingroup$ Could you please tell me how could i make different color for real and imaginary dots in the last graph. And also i need to make different shape for the real and imaginary dots. Thanks $\endgroup$ – rabink May 26 '18 at 21:47
  • $\begingroup$ @rabink check the updated plot. $\endgroup$ – Gopal Verma May 27 '18 at 7:39
  • $\begingroup$ ReIm could be used, if version $ \geq 10.1 $. $\endgroup$ – Αλέξανδρος Ζεγγ May 27 '18 at 8:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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