I cannot open the attached dot file in gvEdit.
I tried to convert it to png file
dot -Tpng final.dot > finalgraph.png
it gives me the following problem:
dot: graph is too large for cairo-renderer bitmaps. Scaling by 0.311296 to fit
dot: failure to create cairo surface: out of memory
My purpose is only to view the dot file, how should I resolve it?
The dot file is here:
https://www.dropbox.com/s/vt2q653x2x9jjbj/final.dot?dl=0
Related
I am using graphviz to create a png file, however when I run my the code, after it generates the image, I try to open the file only to receive a message that either the image file type (png) is unsupported, which I tested using other pngs so I know that can't be the case, or that the file is corrupted. The code I'm running is as follows:
dot -Tpng test.dot -o test.png
with test.dot being:
graph G {
fontname="Helvetica,Arial,sans-serif"
node [fontname="Helvetica,Arial,sans-serif"]
edge [fontname="Helvetica,Arial,sans-serif"]
layout=fdp
"Infinity Blade" -- "Undertow";
"Infinity Blade" -- "Shadow Complex";
.
.
.
"Calvin and Hobbes" -- "XKCD";
"XKCD" -- "Enders Game";
}
When running the code I did also receive two messages, however neither of them had resulted in a corrupted file the first time I received them:
Warning: Overlap value "prism" unsupported - ignored
dot: graph is too large for cairo-renderer bitmaps. Scaling by 0.404306 to fit
I am using Sphinx Documentation tool alongwith LaTeX to generate pdf files.
While trying to include images in the pdf file, I am coming up with the following error during compile:
LaTeX Warning: File `{img_file}.jpg' not found on input line 920.
! Package pdftex.def Error: File `"""{img_file}".jpg' not found: using dra
ft setting.
See the pdftex.def package documentation for explanation.
Type H <return> for immediate help.
...
l.920 ...phinxincludegraphics{{img_file}.jpg}
}
?
These are some key environment variables:
A. In my conf.py, I have defined absolute path as: sys.path.insert(0, os.path.abspath('..'))
B. This is the directory tree:
docs/ # (Sphinx) Documentation folder
_build/
_static/
css/
images/
abc.jpg
img_file.jpg <= This image file is in the root ("_static") directory
_templates/
conf.py
index.rst
modules/ <= Folder containing my source (.rst) files
execute/
file_with_image.rst <= I am trying to put the image in this source file
some_other_file.rst
C. For including the image I am using the following.
.. image:: /_static/img_file.*
D. I have included graphix in conf.py preamble.
Why am I getting this error? What is the source of so many """ quotes in the error message?
Edit
On opening the *.tex file in Tex editor, this is what the code fragment from the image insertion section shows:
\subsection{Add Image}
\label{\detokenize{modules/aud_execution/add_image_with_image_directive:add-image}}\label{\detokenize{modules/aud_execution/add_image_with_image_directive::doc}}
\sphinxstylestrong{Adding an image}
Example of image usage using “image” directive:
\noindent{\hspace*{\fill}\sphinxincludegraphics{{img_file}.jpg}} % ***
Using the Quick Build, the editor throws error as under:
! Package pdftex.def Error: File `"""{img_file}".jpg' not
found: ...
However, when the curly brackets from the image file name, {{img_file}.jpg} are removed and changed it to (line marked ***):
\noindent{\hspace*{\fill}\sphinxincludegraphics{img_file.jpg}} % ***
the document successfully compiles and the image can be seen in the pdf file.
If the .tex file is saved, the pdf file in the _build/latex/ folder shows the image.
So why are the extra brackets being inserted during make latexpdf from the terminal?
Don't place your images under _static. It is special-purpose folder, not for images. E.g. create modules/execute/img/, move image there, and .. image:: img/my-image.png.
In my Sphinx documentation project, I am using images like this:
.. image:: /_static/carousel_filling.png
:width: 300px
:height: 450px
:scale: 100 %
:alt: Image here
:align: right
In the Sphinx HTML docs generated, the images are perfectly displayed in the html pages. However, when I generate pdf documents using make latexpdf, I am coming up with the following error:
'LaTeX Warning: File `{carousel_filling}.png' not found on input line ...'
I tried to find documentation related to outputting images however I came up only with this:
Excertps from:
latex_additional_files A list of file names, relative to the
configuration directory, to copy to the build directory when building
LaTeX output. This is useful to copy files that Sphinx doesn’t copy
automatically, e.g. if they are referenced in custom LaTeX added in
latex_elements. Image files that are referenced in source files (e.g.
via .. image::) are copied automatically.
So as per this, the image files should get automatically added to the output pdf file. But this is not happening. In the pdf file where the image should be there only a blank rectangle can be seen.
Interestingly, I can see that the image file has been copied to the folder _build/latex, so it means that pdflatex is able to access the image file!!
Question
How do I correctly output the images included in my Sphinx documentation in generated pdf file?
Edit 1:
In the terminal I can see the following warning:
LaTeX Warning: File `{carousel_filling}.png' not found on input line 931.
! Package pdftex.def Error: File `"""{carousel_filling}".png' not found: using dra
ft setting.
See the pdftex.def package documentation for explanation.
Type H <return> for immediate help.
...
l.931 ...t=450\sphinxpxdimen]{{carousel_filling}.png}
?
[21]
Edit 2:
In place of the image (where the rectangle outline has been output in pdf file) I can see this:
"""{carousel_filling}".png
Don't place your images under _static. It is a special-purpose folder, not for images. E.g. create img/ at the level of your rst files, move image there, and .. image:: img/my-image.png.
I have a .dpt file I am trying to output a .png and .pdf files out of it and I am using my command line expression as: dot -Tpng SPU123.dot -o SPU123.png to generate .png and it works fine. First, I tried to generate (following graphviz documentation) .pdf by: dot -Tpdf SPU123.dot -o SPU123.pdf but it just generated a blank .pdf and the documentation says there is something buggy with Tpdf option and instead use Tps2 option so I did: dot -Tps SPU123.dot -o SPU123.ps but I got this error:
Error: canvas size (34642,3608) exceeds PDF limit (14400)
(suggest setting a bounding box size, see dot(1))
How to generate .pdf output out of my .dot file?
RGL supports writing DOT files from a graph, is it possible to create a graph from a DOT file?
(Obviously I can parse the DOT file myself and create a graph, but I'm wondering if this functionality exists already).
First you have to install graphviz which gives you the 'dot' command.
Then you can run
dot -Tpng graph.dot > output.png
but I found that after installing dot the rgl method write_to_graphic_file automatically writes the image if you do something like
graph_obj.write_to_graphic_file('png')