Questions tagged [cairo]

Cairo is a software library used to provide a vector graphics-based, device-independent API for software developers.

Cairo is a software library used to provide a vector graphics-based, device-independent API for software developers. It is designed to provide primitives for 2-dimensional drawing across a number of different backends. Cairo is designed to use hardware acceleration when available.

Although written in C, there are bindings for using the cairo graphics library from many other programming languages, including C++, Factor, Haskell, Lua, Perl, Python, Ruby, Scheme, Smalltalk and several others. Dual licensed under the GNU Lesser General Public License and the Mozilla Public License, cairo is free software.

Cairo Homepage includes documentation and examples.

1254 questions
157
votes
16 answers

Convert SVG to PNG in Python

How do I convert an svg to png, in Python? I am storing the svg in an instance of StringIO. Should I use the pyCairo library? How do I write that code?
ram1
  • 6,290
  • 8
  • 41
  • 46
136
votes
10 answers

Package cairo was not found in the pkg-config search path. Node j.s install canvas issue

I am having a problem installing installing the canvas module in node..It seems to be something with cairo I am getting this error... npm http GET https://registry.npmjs.org/canvas npm http 304 https://registry.npmjs.org/canvas npm http GET…
plimbs
  • 1,459
  • 2
  • 10
  • 12
123
votes
2 answers

How can I get the output of a matplotlib plot as an SVG?

I need to take the output of a matplotlib plot and turn it into an SVG path that I can use on a laser cutter. import matplotlib.pyplot as plt import numpy as np x = np.arange(0,100,0.00001) y = x*np.sin(2*pi*x) plt.plot(y) plt.show() For example,…
user391339
  • 8,355
  • 13
  • 58
  • 71
104
votes
9 answers

How to change matplotlib backends

I am struggling with the following issue. I need to generate reports that consists of a collection of charts. All these charts, except one, are made using Matplotlib default backend (TkAgg). One chart needs to be made using the Cairo backend, the…
DrDee
  • 3,549
  • 6
  • 30
  • 37
36
votes
3 answers

Graph is too large for cairo-renderer bitmaps

Im trying to use pyreverse to generate UML images for a project source code. When I run the pyreverse command and specify to generate png images, it runs and then after a while, it shows: dot: graph is too large for cairo-renderer bitmaps. Scaling…
omega
  • 40,311
  • 81
  • 251
  • 474
30
votes
6 answers

Python: OSError: cannot load library libcairo.so.2

I'm having some trouble running a python script on my Windows 7 platform. I've installed Python and also cairo, last one using "pip". I'm running the script using this command: C:\Python34>python.exe label/make_label.py and I get the following…
Niddro
  • 1,705
  • 2
  • 12
  • 24
27
votes
4 answers

How do I prevent Rplots.pdf from being generated?

I am working with some R code that generates a number of images as png files; however, a Rplots.pdf file keeps on being generated in the working directory, is there a way to prevent this from happening? library(Cairo) CairoPNG(file =…
rjzii
  • 14,236
  • 12
  • 79
  • 119
25
votes
3 answers

Getting the Error: Graphics API version mismatch

I'm getting the following error when I run shiny: Error: Graphics API version mismatch Listening on http://127.0.0.1:3774 Warning: Error in Cairo: Graphics API version mismatch [No stack trace available] Any idea how to fix it. My session…
MYaseen208
  • 22,666
  • 37
  • 165
  • 309
23
votes
1 answer

The relationship between libraries: Clutter, Cogl, Clutter, GTK+, etc

I'm a little confused about the relationship of the libraries listed above, here are what I think: Cairo is a 2D graphic library, and GTK+ uses it to render widgets. Cario is low-level. Cogl is a 3D graphic library based on OpenGL(or a fork? I…
molikto
  • 536
  • 3
  • 15
23
votes
7 answers

How do you install PyCairo (Cairo for Python) on Windows?

I spent hours this afternoon trying to find a straightforward tutorial for installing PyCairo on Windows. The Cairo project itself does not maintain Windows binaries, they must be dowloaded elsehere (e.g.…
Claynoik
  • 303
  • 1
  • 2
  • 8
22
votes
9 answers

django OSError: no library called "cairo" was found on windows

When I run the Django server, I see this problem !! OSError: no library called "cairo" was found no library called "libcairo-2" was found cannot load library 'libcairo.so': error 0x7e cannot load library 'libcairo.2.dylib': error 0x cannot load…
Mhmoud Amsha
  • 252
  • 1
  • 2
  • 7
22
votes
5 answers

Package cairo was not found in the pkg-config search path

On Mac OS X 1.7.5 / Lion I am trying to install cairo package using homebrew brew install cairo => PASSED ==> Downloading http://cairographics.org/releases/cairo-1.12.16.tar.xz Already downloaded: /Library/Caches/Homebrew/cairo-1.12.16.tar.xz ==>…
zabumba
  • 12,172
  • 16
  • 72
  • 129
20
votes
2 answers

How to use Cairo PNGs in R Markdown

There are many advantages to using Cairo to save R graphics (see here, for example). When saving PDFs, for instance, the cairo_pdf device correctly embeds custom fonts. Using the cairo_pdf graphics device is easy with ggplot-based graphics with…
Andrew
  • 36,541
  • 13
  • 67
  • 93
20
votes
5 answers

Pango-WARNING **: failed to choose a font, expect ugly output

I'm getting this error when starting anything that uses the Pango library. I'm using Kubuntu 9.10. I've done 'sudo apt-get --reinstall install' on libgtk* libcairo* libpango* and fontconfig, with no luck. Could someone point me in the right…
Andrew
  • 201
  • 1
  • 2
  • 4
19
votes
6 answers

How to unit test a Python function that draws PDF graphics?

I'm writing a CAD application that outputs PDF files using the Cairo graphics library. A lot of the unit testing does not require actually generating the PDF files, such as computing the expected bounding boxes of the objects. However, I want to…
Nathan Farrington
  • 1,890
  • 1
  • 17
  • 27
1
2 3
83 84