![]() ![]() I thought the bounds on the call to Normalize would do that, but apparently not. ![]() I'm sure there's a way to either adjust limits or (harder) write your own Transform to get around it, but I haven't quite managed that yet. Here is a working example - it includes a nasty hack, though (clearly commented). One way I have found is to produce a colormap and then project it onto a polar axis. or |), but none of them go around the second issue.īottom line: can I draw a circle in Python/Matplotlib which is defined in the proper vector/Bezier curve way, and which has an edge color defined according to a colormap (or, failing that, an arbitrary color gradient)? ![]() It's very hard to see in the pixel rendering, but if you zoom in on the vector-based rendering you can clearly see the last disc overlap the first few. Second (relatedly), the final plotted markers (the last few before 2*pi) overlap the first few. This seems to me the 'proper' way of doing it, and the result would look nicer (no banding, better gradient, better anti-aliasing). I would greatly prefer to use an actual circle, defined by a few path points and Bezier curves between them, as in e.g. Although the result looks like a circle, it isn't really. However, this attempt has two serious drawbacks.įirst, when saving the resulting figure as a vector ( figure_1.svg), the color wheel consists (as expected) of 621 different shapes, corresponding to the different (x,y) values being plotted. Norm = (0.0, 2*np.pi)Īx.scatter(xval, yval, c=xval, s=300, cmap=colormap, norm=norm, linewidths=0) The following works OK: import numpy as np I am trying to create a color wheel in Python, preferably using Matplotlib. ![]()
0 Comments
Leave a Reply. |