8/5/2023 0 Comments Arrow and quiver pixel![]() ![]() This result was already available via units='y', but it was awkward to figure out the scale kwarg itself. And I think you will want angles='uv' for this. Can I do that with this?īut if you're doing that, you may want to make more changes, also - you might as well do them all at once.ħ600 Sand Point Way NE (206) 526-6329 fax How exactly are the arrows scaled with scale_units='xy'? What I'd like is for the length of the arrow to the the y scale only - the x scale it irrelevant (x is time, y is velocity). I think gets closer, but I"m not sure it quite gets there: I go to work OK, but I couldn't do exactly what I wanted. You might recall that I spent a bit of time making a "stick plot" with quiver. Matplotlib-users mailing Firing wrote: wrote: Jumpstart yourĭeveloping skills, take BlackBerry mobile applications to market and stay ahead of the curve. Is the only developer event you need to attend this year. (Maybe I should add "width_units", identical to "units", and deprecate the latter this might make the meanings of the kwargs clearer.)Ĭome build with us! The BlackBerry® Developer Conference in SF, CA Previously (and still with the default of scale_units=None), it was almost hopelessly confusing. The new scale_units kwarg makes it much easier to manually set the scale. If I could start from scratch, I probably could come up with a better set of kwarg names and defaults but for reasons of backwards-compatibility, this is what we have. When scale_units is given, the setting of "units" controls only the specification of the arrow width, so if you are not specifying the width, it doesn't have any effect. Q = plt.quiver(,, , scale_units='xy', angles='xy', scale=1) I have committed a change to svn trunk, so that if you change the A scale_units parameter could make it much easier to figure out how to manually set the scale. The present situation does the originally intended autoscaling of arrows reasonably well, but it is very confusing when you need more control. I realize that units='data' might mess up the other measurements of an arrow, though, so maybe another parameter is called for, like a scale_units, that defaults to units. If scale=2, then each arrow would be drawn exactly half of its length. It would be really nice if there was a way to say units='data' (for data coordinates), and then if scale=1, the arrows would be drawn with the heads and tails at exactly the passed points. Furthermore, if I don't make the aspect ratio equal to one, I get wild results since the x-axis and y-axis are different units then. However, with units='x', it's just short, and with units='y', it's just a bit too long. I'm trying to get the arrow to go from (0,0) to (1,1). So I tried even just getting a quiver plot to plot an arrow exactly as I passed it, without it scaling anything. For example, we'd like to scale the vectors to half of their size, and have it look like that on the quiver plot. A couple of us are trying to figure out how to scale arrows in a quiver plot so that we can exactly specify what the output arrows look like. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |