Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

ColorbarBase draws edges in slightly wrong positions. #4584

Closed
@rlabbe

Description

@rlabbe

The code below uses ColorbarBase to print a stacked bar chart of a list of numbers. I usedrawedges=True to get vertical lines to separate the colors with a black line. The lines are often, not always, slightly misaligned compared to the colors and the tick marks, never more than a few pixels. As I drag the matplotlib window larger and slower you can see these edge lines sometimes rendering correctly (right where the colors change) or just a few pixels off. Ithink the error is always to the right.

I've attached an example image. If you click the image to see if full scale you'll see a several pixel error at 0.3, and perhaps a 1 pixel error at 0.4. If I drag the window to a different size I can make these errors larger or smaller.

Environment:
Windows 7
Anaconda Python 3.4, 64 bit installation.
matplotlib 1.4.3
Qt graphics back end

    import matplotlib as mpl    import matplotlib.pyplot as plt    a = [.0, .1, .3, .4, 1.]    cmap = mpl.colors.ListedColormap([[0., .4, 1.],                                      [0., .8, 1.],                                      [1., .8, 0.],                                      [1., .4, 0.],                                      [0., .4, 1.]])    fig = plt.figure(figsize=(6,3))    ax = fig.add_axes([0.05, 0.475, 0.9, 0.15])    norm = mpl.colors.BoundaryNorm(a, cmap.N)    mpl.colorbar.ColorbarBase(ax, cmap=cmap,                                  norm=norm,                                  drawedges=True,                                  spacing='proportional',                                  orientation='horizontal')    plt.show()

figure_3

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp