Thanks to visit codestin.com
Credit goes to github.com

Skip to content

BboxConnectorPatch does not show facecolor #8059

Closed
@jotasi

Description

@jotasi

Bug report

Bug summary

When adding a BboxConnectorPatch, the edges are displayed correctly but the facecolor is not shown. The face is empty.

Code for reproduction

import numpy as np
import matplotlib.pyplot as plt
from matplotlib.transforms import Bbox, TransformedBbox, \
     blended_transform_factory
from mpl_toolkits.axes_grid1.inset_locator import BboxPatch, BboxConnector,\
     BboxConnectorPatch
fig, ax = plt.subplots(1, 2)
fig.set_size_inches(12, 6)
fig.set_tight_layout(True)
ax[0].set_xlim(0, 1)
ax[0].set_ylim(0, 1)
ax[1].set_xlim(0, 1)
ax[1].set_ylim(0.35, 0.65)
trans1 = blended_transform_factory(ax[0].transData, ax[0].transData)
trans2 = blended_transform_factory(ax[1].transData, ax[1].transData)
bbox = Bbox.from_extents(0, 0.4, 1, 0.6)
bbox1 = TransformedBbox(bbox, trans1)
bbox2 = TransformedBbox(bbox, trans2)
p = BboxConnectorPatch(bbox1, bbox2,
                       loc1a=1, loc2a=2, loc1b=4, loc2b=3, ec="b", fc="b")
p.set_clip_on(False)
ax[0].add_patch(p)
ax[1].yaxis.tick_right()
plt.show()

Actual outcome

download

Expected outcome

I would expect the trapezoid to be filled in blue rather than to be empty.

Matplotlib version
Matplotlib version: 2.0.0
Python version: 3.4.2
Platform: Linux
Python was installed from the debian repositories and matplotlib was installed via pip.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions