python - Matplotlib Rectangle With Color Gradient Fill -
I want to make a rectangle, together with a gradient color from left to right, with my arbitrary an arbitrary manner In case the axis example ( ax1 ) coordinate system.
My first thought was Create a path patch and somehow set your fill as a color gradient. But there is no way to do this accordingly.
Next I tried to use a color palette I used the ax2 fig.ed_xs ([left, bottom, width, height]) > Created and added a color bar for it
ax2 = fig.add_axes ([0, 0, width, height / 8]) color = [grad_start_color, grad_end_color] index = [0.0, 1.0] cm = Linear Segment Colormap.from_list ('my_colormap', zip (index, color)) colorbar.ColorbarBase (ax2, cmap = cms, orientation = 'horizontal')
< P> but positional paragraph Itr FIG.
is in the coordinate system of Fig , and the coordinate system of ax1 does not match. How can I do this?
Thanks for any help.
Have you ever solved this? I wanted to do the same thing and wanted to use the coordinate mapping from
Comments
Post a Comment