Python Forum
colorbar for scatter shows no negatives values...
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
colorbar for scatter shows no negatives values...
#1
Hi everyone !

i made a program that should give me a beautiful graph with X, Y and color for the Z variable. But the color only gives me positive values, and not the negatives. I print my Z values and there are many negatives, so i should have it but i don't....

here is my program, i would be grateful if you can help me :
import numpy as np
import matplotlib.pyplot as plt
data = np.loadtxt("table2.txt")
print (data[2,0])
x=data[:,23]
y=data[:,20]
Z=data[:,0]
plt.scatter(x,y,Z,cmap='jet')
plt.colorbar()
plt.show()
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Shocked plt.scatter() errors asja2010 0 1,411 Oct-13-2022, 08:15 AM
Last Post: asja2010
  ModuleNotFound but pip shows module installed biscotty666 2 1,511 Jul-14-2022, 05:17 PM
Last Post: Axel_Erfurt
  Os command output in variable shows wrong value paulo79 2 1,467 Apr-09-2022, 03:48 PM
Last Post: ndc85430
  [Solved] Matplotlib - Tricontour: how to set colorbar range ju21878436312 1 6,435 Dec-13-2021, 07:44 PM
Last Post: ju21878436312
  How to invert scatter plot axis Mark17 3 2,447 Sep-22-2021, 04:45 PM
Last Post: jefsummers
  Animated scatter plot maximan 0 1,616 Jan-18-2021, 03:53 PM
Last Post: maximan
  Help in designing a timestamp finder for chapter-less TV shows Daring_T 1 1,819 Oct-26-2020, 09:30 PM
Last Post: Daring_T
  Group scatter plots Mekala 0 1,617 Jul-23-2020, 02:18 PM
Last Post: Mekala
  Plotting 3D Data with Custom Colorbar Gates666 0 1,668 Jul-09-2020, 10:56 AM
Last Post: Gates666
  how to nest loop for 4*4 scatter plot kassamohammed 0 2,544 Jun-23-2020, 09:47 AM
Last Post: kassamohammed

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020