I'm trying to think of a better way to visualize this data. I want to see how the…
- User
I'm trying to think of a better way to visualize this data. I want to see how the relationship between confidence loss score and absolute error changes with vertical level, but the plots end up overlapping each other. I think I may be trying to see the relationship between 3 variables on a 2d plot. Do you have advice on how to go about this?
import matplotlib.pyplot as plt import matplotlib.cm as cm from matplotlib.cm import ScalarMappable # Define the indices indices = list(range(0,60)) # Choose a colormap cmap = cm.get_cmap('viridis') # Normalize based on index values norm = plt.Normalize(vmin=min(indices), vmax=max(indices)) # Get the current axes (where the scatter plots are drawn) ax = plt.gca() # Plot each scatter with color based on index value for idx in indices: plt.scatter( nn_conf[:, 1,idx], nn_abs_diff[:, 1, idx], s=4, alpha=0.5, color=cmap(norm(idx)), label=f'Index {idx}' ) # Create ScalarMappable for the colorbar sm = ScalarMappable(cmap=cmap, norm=norm) sm.set_array([]) # Required for older versions # Add the colorbar and explicitly specify the Axes cbar = plt.colorbar(sm, ax=ax) # <-- Pass the Axes here cbar.set_label('Vertical Level Index') # Optional: Add labels and title plt.xlabel("Confidence Loss Score") plt.ylabel("Absolute Error") plt.title("Confidence Loss vs Absolute Error") plt.show()
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.