Hi All
I've been knocking my head against this, and wondered if anyone had any insights.
I've made a plot with the wonderful matplotlib. I've always found it to work brilliantly, and I've found that even without knowing much about it I can get it to do most of the things I've wanted it to do.
Today, I wanted to insert a few arrows onto my graphs to point out some features. They didn't need any text or other annotation. Just the simplest imaginable vertical arrows. Imagine my surprise, when this turned out to be impossible for me to do.
I tried various things with arrow and annotate. With arrow I managed to get a thick vertical line where I wanted the arrow. But I couldn't figure out how to make it look like an arrow. I realised that the arrows it was trying to draw were a lot fancier than I needed, but I tried various combinations and nothing. I feel really stupid at this point.
So let's make it more specific. A set of axes with x running from 200 to 300, and y running from 0.5 to 1.5. I want something that looks like a little arrow pointing down, so the tip is at (250, 1.3) and the tail is at (250,1.45) say.
Any ideas of how this could be done? It must be simple, surely!
The next level of complication (although just achieving the above would cause great joy), is that sometimes I'd like the arrow to go beyond the bounds of the axes. Say (260,1.45) to (260,1.6). Any ideas?
Lastly, can I just impose the arrows on the whole figure, rather than on a specific set of axes, so that I can easily have arrows the same size regardless of the number of subplots and what their scales are? Of course this is the least important, because it can be calculated...
Many thanks!
I've been knocking my head against this, and wondered if anyone had any insights.
I've made a plot with the wonderful matplotlib. I've always found it to work brilliantly, and I've found that even without knowing much about it I can get it to do most of the things I've wanted it to do.
Today, I wanted to insert a few arrows onto my graphs to point out some features. They didn't need any text or other annotation. Just the simplest imaginable vertical arrows. Imagine my surprise, when this turned out to be impossible for me to do.
I tried various things with arrow and annotate. With arrow I managed to get a thick vertical line where I wanted the arrow. But I couldn't figure out how to make it look like an arrow. I realised that the arrows it was trying to draw were a lot fancier than I needed, but I tried various combinations and nothing. I feel really stupid at this point.
So let's make it more specific. A set of axes with x running from 200 to 300, and y running from 0.5 to 1.5. I want something that looks like a little arrow pointing down, so the tip is at (250, 1.3) and the tail is at (250,1.45) say.
Any ideas of how this could be done? It must be simple, surely!
The next level of complication (although just achieving the above would cause great joy), is that sometimes I'd like the arrow to go beyond the bounds of the axes. Say (260,1.45) to (260,1.6). Any ideas?
Lastly, can I just impose the arrows on the whole figure, rather than on a specific set of axes, so that I can easily have arrows the same size regardless of the number of subplots and what their scales are? Of course this is the least important, because it can be calculated...
Many thanks!
Comment