Python Forum
Plotting 3D Data with Custom Colorbar
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Plotting 3D Data with Custom Colorbar
#1
Hello,

I'm new to Python and I require some help. This might be pretty easy for most of you, but not for me. I'm working on my Bachelor's Degree and I have to plot some Data.

My Data looks like this:

WK____WLF____TF_____Rsquared
x_______y______z_________R
x_______y______z_________R
x_______y______z_________R
x_______y______z_________R
......................... 1 Million rows

I want to plot WK on the X Axis, WLF on the Y Axis and TF on the Z Axis. Every point in the plot shall be colored to it's rsquared value. But I just want a colorbar for rsquared > 0.6. All rsquared values below 0.6 should be grey or not visible. Is that possible? This is what I have so far. Sorry if it's completely wrong. I've searched the Internet but I could'nt find help and applying unspecific solutions is kinda difficult for me.

res = pd.read_csv("GP1_parameterization5.csv") 
fig = plt.figure()
ax = fig.gca(projection='3d')

x1=res['WK']                                                                #WK
x2=res['WLF']                                                               #WLF
x3=res['TF']                                                                 #TF


p=ax.scatter(x1,x2,x3,c=res['rsquared'])                                           

fig.colorbar(p,ticks=[0.6,0.7,0.8,0.9,1],extend="min")


I am really grateful for your help.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [Solved] Matplotlib - Tricontour: how to set colorbar range ju21878436312 1 6,617 Dec-13-2021, 07:44 PM
Last Post: ju21878436312
  [Solved] Plotting data from txt file Laplace12 1 1,819 Jul-06-2021, 07:14 AM
Last Post: Laplace12
  Plotting sum of data files using simple code Laplace12 3 3,047 Jun-16-2021, 02:06 PM
Last Post: BashBedlam
Smile Set 'Time' format cell when writing data to excel and not 'custom' limors 3 6,304 Mar-29-2021, 09:36 PM
Last Post: Larz60+
  ctypes and custom data type (structures, pointer to structures) python_user_n 0 2,662 Jul-08-2020, 05:52 PM
Last Post: python_user_n
  Python animate live plotting fetching data from Mysql Table dhirajm 6 3,643 Apr-24-2020, 05:07 PM
Last Post: dhirajm
  colorbar for scatter shows no negatives values... gil 0 1,539 Apr-15-2020, 12:45 AM
Last Post: gil
  plotting data without plt.clear() omar_mohsen 0 1,655 Jan-04-2020, 08:30 PM
Last Post: omar_mohsen
  Custom data structure icm63 2 2,538 Mar-27-2019, 02:40 AM
Last Post: icm63
  Matplotlib Colorbar Ticks (Increase number) BennyS 1 8,838 Apr-18-2018, 04:00 PM
Last Post: BennyS

Forum Jump:

User Panel Messages

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