cairo

Cannot import matplotlib.pyplot in python 3

Deadly 提交于 2019-12-08 04:53:00
问题 I followed the instructions to install matplotlib for python 3 from here: How to install matplotlib with Python3.2 But I get an ImportError, which I have not been able to resolve, when importing pyplot: >>> import matplotlib >>> import matplotlib.pyplot as plt Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python3.2/dist-packages/matplotlib-1.4.x-py3.2-linux-i686.egg/matplotlib/pyplot.py", line 98, in <module> _backend_mod, new_figure_manager, draw

C/GTK+3 draw event for multiple widgets

[亡魂溺海] 提交于 2019-12-08 02:27:40
问题 I am currently trying to learn GTK+3/cairo using C. I have written a small application which draws a gauge face and needle on a gtk drawing area using cairo. This works well so far, i have tried creating multiple drawing areas (multiple gauges) which all have the same callback function for the draw event, this also works well with static values. Now my question, i would like to be able to draw multiple gauges each with their own values. But how do i know in my callback function which gauge

Filling a custom-shaped Clutter Actor with a Cairo-drawn canvas

扶醉桌前 提交于 2019-12-08 02:15:39
问题 Clutter 1.12 Cogl 1.10 Vala or C or Python. I might have a fundamental misunderstanding here — I think of "Actors" as 3D polygon things. I think of their colours as either vertex colors or as texture-mapping. In this light, I have been trying to draw a custom Actor and fill it with stuff drawn via Cairo. I'm not getting anywhere. Code is included below (in Vala). Can anyone set me right about Clutter's basics (the docs just don't cut it) or, if I'm close, help me get that code working. I

Checking if path is simple and closed using cairo

主宰稳场 提交于 2019-12-07 23:55:29
I am using cairomm together with gtkmm for a GUI project. I have defined a GeometricShape abstract widget (which inherits from Gtk::DrawingArea ) to inherit from if one needs to draw a square, a circle, etc. This class defines three regions: a fill (or body area); a border; a background area. The fill area is used to fill in the shape with a certain body color. The border (usually black) defines the shape and the background area is used to fill the remaining space (everything but the border and its related fill area) with a color. Here is an example of how it looks for a circle: In this case,

Activating cairo-dependent features of graph_tool

余生长醉 提交于 2019-12-07 19:16:47
问题 I have been using the graph-tool library for a while now, thus far I hadn't really been using most of its drawing features. Today when trying to use graph_tool.draw.graph_draw I realised that I had configured graph-tool initially without cairo, ./configure --disable-cairo and this is exactly the graphics library that graph_draw uses. If I install cairo now, is there a way to activate the features of graph_tool that rely on cairo without having to remove and reinstall the whole graph_tool

How to rotate image using GTK+ / Cairo

一个人想着一个人 提交于 2019-12-07 18:55:01
问题 I've got a simple application that is supposed to rotate a decorated wheel so many degrees every x number of milliseconds using GTK+ and Cairo . I've got some code below that calls cairo_rotate() from a timer. However, the image doesn't change. Do I have to invalidate the image to cause the expose-event to fire? I'm so new to Cairo that a simple example demonstrating how to rotate an image using Cairo in GTK+ would be highly appreciated. #include <cairo.h> #include <gtk/gtk.h> cairo_surface_t

Set system font in R package Cairo in Mac OS X

江枫思渺然 提交于 2019-12-07 16:10:14
问题 Because of the issue raised in Using Unicode inside R's expression() command, I am switching to R on Mac OS X to create some plots. Using CairoPDF() , however, the commands I use in Windows to select my fonts don't have any effect on Mac OS X, where the output .pdf file always has the Helvetica font. library(package = "Cairo") CairoPDF("test.pdf") plot.new() text(x=.5,y=.5,labels="\u0260",family="Times New Roman") dev.off() The output in Windows is: The output in Mac OS X is: The Times New

Gulp issues with cario install command not found when trying to installing canvas

半世苍凉 提交于 2019-12-07 12:48:11
问题 I'm fairly new to working in command line. I have a project that I'm setting up with gulp, and have gulp installed and compiling the sass files successfully. However, I cannot install canvas via: $ npm install canvas I need to install canvas because of the dependencies css-sprite has to run. I am getting the following error. I have installed cairo, quartz, and homebrew installed. I've researched other tickets and tried to run the export PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig and install again

get cairosvg working in windows

寵の児 提交于 2019-12-07 10:04:13
问题 Trying to get this code working: import cairosvg import os path = "D:/PyProjects/Bla/Temp" os.chdir(path) cairosvg.svg2pdf(url='Pic.svg', write_to='image.pdf') but get errors along similar to this post: Traceback (most recent call last): File "D:/work/lean_python/pdf/other.py", line 2, in <module> import cairosvg File "D:\env_python352\lib\site-packages\cairosvg\__init__.py", line 29, in <module> from . import surface File "D:\env_python352\lib\site-packages\cairosvg\surface.py", line 24, in

How to display interactive SVG in a window on Linux?

倖福魔咒の 提交于 2019-12-07 09:22:40
问题 I really like SVG, it's very nice to draw with it. So far i've made static images using Inkscape. I'd like to make them interactive though. I did some trials, following tutorials like this one. But i can see a SVG and interact with it in my web browser only. I'd like to make such things in a window on the desktop. There are drawing kits like Cairo or OpenGL, but then i have to draw from code. It seems a more clever thing to use SVG (which was drawn using Inkscape). What does it require to