Colormap eine 3D -Kurve in MatplotlibPython

Python-Programme
Anonymous
 Colormap eine 3D -Kurve in Matplotlib

Post by Anonymous »

Ich habe 4 Arrays x , y , z und t der Länge n und ich möchte eine 3D -Kurve mit Matplotlib zeichnen. Die (x, y, z) sind die Punktpositionen und T ist der Wert jedes Punktes (der als Farbe als Farbe dargestellt wird) wie die Temperatur jedes Punktes. Wie kann ich das tun?

Code: Select all

import numpy as np
from matplotlib import pyplot as plt

fig = plt.figure()
ax = fig.gca(projection='3d')
n = 100
cmap = plt.get_cmap("bwr")
theta = np.linspace(-4 * np.pi, 4 * np.pi, n)
z = np.linspace(-2, 2, n)
r = z**2 + 1
x = r * np.sin(theta)
y = r * np.cos(theta)
T = (2*np.random.rand(n) - 1)  # All the values are in [-1, 1]
Was ich über das Internet gefunden habe:
  • Es ist möglich, CMAP mit Streuung wie in den Dokumenten und in dieser stackoverflow-Frage

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post