Skip to content

Bivariate and multivariate colorbar #30527

@trygvrad

Description

@trygvrad

Project Bivariate and Multivariate Colormapping, which resolves github.com//issues/14168 is divided into a number of milestones, of which this is one (highlighted in bold).

  • Classes for bivariate and multivariate colormaps
  • Colorizer and ColorizingArtist to replace ScalarMappable and handle the norm→color pipeline
  • A MultiNorm class to handle the normalization of data for bivariate and multivariate colormaps
  • Ensure the Colorizer and ColorizingArtist work with MultiNorm, BivarColormap and MultivarColormap
  • Expose the new functionality via the top-level plotting functions: imshow(), pcolor() and pcolormesh()
  • Create equivalents to fig.colorbar() for BivarColormap and MultivarColormap to work with ColorizingArtist
  • Select bivariate and multivariate colormaps to include in matplotlib
  • Examples demonstrating the new functionality

The following prototype uses a hypothetical function fig.colorbar_2D(ColorizingArtist) to display a BivarColormap:

x = np.linspace(-1.5, 0.5, 200)
y = np.linspace(-1, 1, 200)
xx, yy = np.meshgrid(x, y)
c = xx+1j*yy
z = c
for i in range(7):
    z = z**2+c

fig, ax = plt.subplots(1, 1, figsize=(10, 6))

cm = ax.pcolormesh(xx, yy, (z.imag, z.real), cmap='BiCone', vmin=-1, vmax=1)
ax.set_xlabel('Re{$c$}')
ax.set_ylabel('Im{$c$}')
ax.set_title('Mandelbrot $z_{7}$\n $z_i = z_{i-1}^2+c$')

cmap = fig.colorbar_2D(cm)
cmap.set_ylabel('Im{$z$}')
cmap.set_xlabel('Re{$z$}')

fig.show()
Image

While the name colorbar_2D is provisional, this functionality will be required as part of Bivariate and Multivariate Colormapping.

Main questions include:

  • Function name
  • Should the function return an a new subclass of Axes? (subclass colorbar?) What members do the new class need?
  • Placement

Similar questions arise for the MultivarColormap class, i.e. in making the following plot:

Image

No work is expected on this issue until the milestones above it in Bivariate and Multivariate Colormapping have been reached.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    In Progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions