Home » Python » python – How to plot the unitary sphere with different norms?-Exceptionshub

python – How to plot the unitary sphere with different norms?-Exceptionshub

Posted by: admin February 24, 2020 Leave a comment

Questions:

I want to plot the set {x ∈ ℝ²} with different the infinite, 1, euclidean, and the p norm with p=1.5,2,3 on the same figure, but how can I get this set as a list in Python so I can actually plot it?

My teacher recommended to use a random function to generate 100 unitary vectors with each of the norms, but I couldn’t find such function.

I was thinking of doing a conditional if with each norm over a numpy.linspace, evaluating each vector if they do have norm 1 with each vector norm and save the results in a list.

How to&Answers: