TransWikia.com

Why does ComplexListPlot labeling function require an Evaluate?

Mathematica Asked on January 1, 2021

Start with the list of the cube-roots of unity:

cubeRoots = ComplexExpand[Exp[(2 [Pi] Range[0, 2] I)/3]]

I want to use ComplexListPlot to plot these three points and label each of them with its value.

Noting the the first example in the documentation for the "LabelingFunction" option to ComplexListPlot, namely…

ComplexListPlot[{1, E^((2 I [Pi])/7), E^((4 I [Pi])/7), E^((
   6 I [Pi])/7), E^((8 I [Pi])/7), E^((10 I [Pi])/7), E^((
   12 I [Pi])/7)} -> {0, 1, 2, 3, 4, 5, 6}]

…I tried the following;

ComplexListPlot[cubeRoots -> cubeRoots,
  PlotStyle -> Directive[Red, PointSize[Large]],
  Ticks -> None, PlotRange -> 1.5,BaseStyle -> {11},
  ImageSize -> Scaled[0.5]]

That fails, with error: "ComplexListPlot called with 0 arguments; 1 argument is expected."

Wrapping the first instance of cubeRoots with Evaluate works, however:

ComplexListPlot[Evaluate[cubeRoots] -> cubeRoots,
 PlotStyle -> Directive[Red, PointSize[Large]],
 Ticks -> None, PlotRange -> 1.5, BaseStyle -> {11},
 ImageSize -> Scaled[0.5]]

Cube roots of unity plot

Question: Why is the Evaluate needed to wrap around the left-hand side of the Rule that constitutes, in effect, the argument to ComplexListPlot?

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP