annotate

Custom arrow style for matplotlib, pyplot.annotate

有些话、适合烂在心里 提交于 2019-11-27 16:24:39
问题 I am using matplotlib.pyplot.annotate to draw an arrow on my plot, like so: import matplotlib.pyplot as plt plt.annotate("",(x,ybottom),(x,ytop),arrowprops=dict(arrowstyle="->")) I want to use an arrow style that has a flat line at one end and an arrow at the other, so combining the styles "|-|" and "->" to make something we might call "|->", but I can't figure out how to define my own style. I thought I might try something like import matplotlib.patches as patches myarrow = patches

How to annotate ggplot2 qplot outside of legend and plotarea? (similar to mtext())

半城伤御伤魂 提交于 2019-11-27 06:50:23
问题 I would like to annotate my plots with a filename. With plot() I used mtext : plot(1:10) mtext("File xy-12-34-56.csv", 4) How can I do that with ggplot2 and qplot or ggplot? It should not collide with the legend. I found the commands annotate and grid , but I could not get an annotation similar to mtext with these. As a workaround I could try watermarks, but perhaps you have a good hint for me. Kind regards, Jonas 回答1: Update Looks like to achieve the result now we should use the following:

how to use imagick annotateImage for chinese text?

给你一囗甜甜゛ 提交于 2019-11-27 06:09:07
问题 I need to annotate an image with Chinese Text and I am using Imagick library right now. An example of a Chinese Text is 这是中文 The Chinese Font file used is this The file originally is named 华文黑体.ttf it can also be found in Mac OSX under /Library/Font I have renamed it to English STHeiTi.ttf make it easier to call the file in php code. In particular the Imagick::annotateImage function I also am using the answer from "How can I draw wrapped text using Imagick in PHP?". The reason why I am using

Annotate PDF within iPhone SDK

陌路散爱 提交于 2019-11-27 02:58:40
I have managed to implement a very basic PDF viewer within my application, but was wondering if it was possible to add annotations to the PDF. I have looked through the SDK docs, but not found anything. I have 2 questions really: Is it possible to do this? What is the best approach to take? Is there a framework or library that I can include to assist with this? Thanks. You can do annotation by reading in a PDF page, drawing it onto a new PDF graphics context, then drawing extra content onto that graphic context. Here is some code that adds the words 'Example annotation' at position (100.0,100

How can I wrap text using Imagick in PHP so that it is drawn as multiline text?

六眼飞鱼酱① 提交于 2019-11-26 20:29:13
问题 The Imagick library in PHP allows you to draw text on top of an image. How can I tell Imagick to wrap the text based upon some bounded text box, so that the words appear as multiline text rather than a single line? 回答1: Usage: list($lines, $lineHeight) = wordWrapAnnotation($image, $draw, $msg, 140); for($i = 0; $i < count($lines); $i++) $image->annotateImage($draw, $xpos, $ypos + $i*$lineHeight, 0, $lines[$i]); Function: /* Implement word wrapping... Ughhh... why is this NOT done for me!!! OK

Annotate PDF within iPhone SDK

故事扮演 提交于 2019-11-26 17:30:10
问题 I have managed to implement a very basic PDF viewer within my application, but was wondering if it was possible to add annotations to the PDF. I have looked through the SDK docs, but not found anything. I have 2 questions really: Is it possible to do this? What is the best approach to take? Is there a framework or library that I can include to assist with this? Thanks. 回答1: You can do annotation by reading in a PDF page, drawing it onto a new PDF graphics context, then drawing extra content

Label python data points on plot

亡梦爱人 提交于 2019-11-26 15:51:54
I searched for ages (hours which is like ages) to find the answer to a really annoying (seemingly basic) problem, and because I cant find a question that quite fits the answer I am posting a question and answering it in the hope that it will save someone else the huge amount of time I just spent on my noobie plotting skills. If you want to label your plot points using python matplotlib from matplotlib import pyplot as plt fig = plt.figure() ax = fig.add_subplot(111) A = anyarray B = anyotherarray plt.plot(A,B) for i,j in zip(A,B): ax.annotate('%s)' %j, xy=(i,j), xytext=(30,0), textcoords=

Matplotlib overlapping annotations / text

∥☆過路亽.° 提交于 2019-11-26 07:59:31
I'm trying to stop annotation text overlapping in my graphs. The method suggested in the accepted answer to Matplotlib overlapping annotations looks extremely promising, however is for bar graphs. I'm having trouble converting the "axis" methods over to what I want to do, and I don't understand how the text lines up. import sys import matplotlib.pyplot as plt # start new plot plt.clf() plt.xlabel("Proportional Euclidean Distance") plt.ylabel("Percentage Timewindows Attended") plt.title("Test plot") together = [(0, 1.0, 0.4), (25, 1.0127692669427917, 0.41), (50, 1.016404709797609, 0.41), (75, 1

Label python data points on plot

我的未来我决定 提交于 2019-11-26 04:11:55
问题 I searched for ages (hours which is like ages) to find the answer to a really annoying (seemingly basic) problem, and because I cant find a question that quite fits the answer I am posting a question and answering it in the hope that it will save someone else the huge amount of time I just spent on my noobie plotting skills. If you want to label your plot points using python matplotlib from matplotlib import pyplot as plt fig = plt.figure() ax = fig.add_subplot(111) A = anyarray B =

Matplotlib overlapping annotations / text

耗尽温柔 提交于 2019-11-26 02:08:45
问题 I\'m trying to stop annotation text overlapping in my graphs. The method suggested in the accepted answer to Matplotlib overlapping annotations looks extremely promising, however is for bar graphs. I\'m having trouble converting the \"axis\" methods over to what I want to do, and I don\'t understand how the text lines up. import sys import matplotlib.pyplot as plt # start new plot plt.clf() plt.xlabel(\"Proportional Euclidean Distance\") plt.ylabel(\"Percentage Timewindows Attended\") plt