cairo

Why curved edges are invisible in igraph plotting?

五迷三道 提交于 2019-12-24 10:46:42
问题 In python igraph plotting with cairo PDF, curved edges set either by edge_curved = X or autocurve = True , edges are invisible in the PDF output. Same stands for PNG. Arrowheads and all other graphic elements are visible. Setting the edges straight, they become visible. Here is a minimal example: import igraph g = igraph.Graph.Erdos_Renyi(n = 23, m = 123) igraph.plot(g, autocurve = True, edge_width = 0.02) 回答1: With edge width below 0.051 the curved edges are always invisible. Actually all

python: open file, feed line to list, process list data

允我心安 提交于 2019-12-24 07:40:22
问题 I want to process the data in the file "output.log" and feed it to graphdata['eth0] I have done this but it process only the first line: logread = open("output.log", "r").readlines() for line in logread: print "line", line i = line.rstrip("\n") b = float(i) colors = [ (0.2, 03, .65), (0.5, 0.7, .1), (.35, .2, .45), ] graphData = {} graphData['eth0'] = [b] cairoplot.dot_line_plot("./blog", graphData, 500, 500, axis=True, grid=True, dots=True, series_colors=colors) 回答1: graphData = {} I believe

Cairo library and Cmake

て烟熏妆下的殇ゞ 提交于 2019-12-23 17:38:37
问题 I'm new to c++ and cmake. I installed cairo library as written here via port. Now i want to include cairo to my project. I wrote the CmakeLists.txt commands as shown here. cmake_minimum_required(VERSION 3.6) project(HelloOpenGL) set(CMAKE_CXX_STANDARD 11) set(SOURCE_FILES main.cpp) add_executable(HelloOpenGL ${SOURCE_FILES}) #find_package(ImageMagick COMPONENTS Magick++) #include_directories(${ImageMagick_INCLUDE_DIRS}) #target_link_libraries(HelloOpenGL ${ImageMagick_LIBRARIES}) find_package

Create cairo path from SVG file

时光毁灭记忆、已成空白 提交于 2019-12-23 15:02:07
问题 There must be something I am missing. I am on Windows and want to use python to take the paths from a SVG-file, scale them an place every single one of them on a new surface (or all on one, that doesn't really matter). I read about cairo here and on stackoverflow and it seemed to me, that it would fit my needs, but I could not find an easy way to generate a path from a svg file. Is there no easier solution than parsing the SVG by hand eg. with xml? 回答1: CairoSVG parses SVG files and renders

Using Cairo Regions in python with gi.repository

こ雲淡風輕ζ 提交于 2019-12-23 10:07:37
问题 I can't seem to get cairo regions working in within using the gintrospection. For example from gi.repository import cairo reg = cairo.Region() will give me Traceback (most recent call last): File "<stdin>", line 1, in <module> MemoryError and trying to get a region from Gdk.get_clip_region() will give me return info.invoke(*args) TypeError: Couldn't find conversion for foreign struct 'cairo.Region' What obvious thing am I missing? I can't find a way to iniatilize the library, and can't

using cairo with gtk3

≯℡__Kan透↙ 提交于 2019-12-23 03:06:59
问题 I am trying to draw a scatterplot with cairo in gtk3. To start, I am using the examples here: http://zetcode.com/tutorials/cairographicstutorial/ They compile with gtk2 successfully but display no image. They do not compile with gtk3 but give the following error: example.c: In function ‘on_expose_event’: example.c:17:31: error: ‘GtkWidget’ has no member named ‘window’ Any help on this would be greatly appreciated. btw I am using writing using ArchLinux for this if that helps. 回答1: There have

Installing Cairo on OS X Lion

扶醉桌前 提交于 2019-12-22 12:25:38
问题 When I try to install Cairo on OS X Lion with Python 2.7.2 it just does not work, I can build and install it, but when it comes to import cairo in python it can't be found. I have tried the How to install PyCairo 1.10 on Mac OSX with default and it just produces this error "_cairo_xlib_surface_get_width", referenced from: _xlib_surface_get_width in surface.c.1.o ld: symbol(s) not found for architecture i386 collect2: ld returned 1 exit status lipo: can't open input file: /var/folders/l9

py2cairo installation failure. Checking for 'cairo' >= 1.10.0 : not found

萝らか妹 提交于 2019-12-22 06:22:34
问题 I am trying to install PyCairo (from tarball source) on my OS X 10.5 using 32-bit Python 2.7 (from python.org) and cairo 1.10.2 from MacPorts. So I am installing "py2cairo". When I run python ./waf configure , I get Checking for 'cairo' >= 1.10.0 : not found I have cairo files here... $ ls /opt/local/include/cairo cairo-deprecated.h cairo-gobject.h cairo-script-interpreter.h cairo-tee.h cairo-xlib-xrender.h cairo.h cairo-features.h cairo-pdf.h cairo-script.h cairo-version.h cairo-xlib.h cairo

Create PDF with (resized) PNG images using Pycairo - rescaling Surface issue

折月煮酒 提交于 2019-12-21 20:59:57
问题 I have som PNG image links that I want to download, "convert to thumbnails" and save to PDF using Python and Cairo. Now, I have a working code, but I don't know how to control image size on paper. Is there a way to resize a PyCairo Surface to the dimensions I want (which happens to be smaller than the original)? I want the original pixels to be "shrinked" to a higher resolution (on paper). Also, I tried Image.rescale() function from PIL, but it gives me back a 20x20 pixel output (out of a

quickest way to get started with cairo

僤鯓⒐⒋嵵緔 提交于 2019-12-18 16:55:18
问题 I have taken passing shots at learning Cairo in the past, but always moved on in favor of some other graphics library. My problem is that I can't find a good tutorial that gives me a simple display for my surface. I have always ended up digging through GTK or QT documentation about things that have nothing to do with what I want to do. I want to learn Cairo, not a massive OO architecture. What is a bare bones wrapper to give me a cross-platform window with a Cairo canvas to draw on? 回答1: I