Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7569441
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T15:10:00+00:00 2026-05-30T15:10:00+00:00

I have a code block with a simple command: #+begin_src R :results output graphics

  • 0

I have a code block with a simple command:

#+begin_src R :results output graphics :exports results :file a.png
print(qplot(a,binwidth=1)+opts(title="graph title")+scale_x_continuous("axis lable")+scale_y_continuous(formatter="comma"))
#+end_src

I load ggplot2 in an earlier block of this session, and it works fine when I do C-c C-c to execute that block.

When I try C-c C-e h or C-c C-e P to export or publish the file, it writes an a.png of length 0.

Here are some of the #+ lines at the start of this file:

#+OPTIONS:   H:3 num:t toc:t \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t
#+OPTIONS:   TeX:t LaTeX:t skip:nil d:nil todo:t pri:nil tags:not-in-toc
#+INFOJS_OPT: view:info toc:nil ltoc:t mouse:underline buttons:0 path:http://orgmode.org/org-info.js
#+EXPORT_SELECT_TAGS: export
#+EXPORT_EXCLUDE_TAGS: noexport
#+BABEL: :session *R* :cache yes :exports both :tangle yes

I’m running “GNU Emacs 23.3.1 (i386-mingw-nt5.2.3790) of 2011-03-10 on 3249CTO” on an XP64 system and “Org-mode version 7.5”.

What am I missing? I didn’t find the answer in my search of Stack Overflow, the org-mode mailing list, the manuals, or Google.

I tried a simple, executable file this morning:

#+TITLE:     test.org
#+AUTHOR:    
#+EMAIL:     me
#+DATE:      2012-03-01 Thu
#+DESCRIPTION:
#+KEYWORDS:
#+LANGUAGE:  en
#+OPTIONS:   H:3 num:t toc:t \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t
#+OPTIONS:   TeX:t LaTeX:t skip:nil d:nil todo:t pri:nil tags:not-in-toc
#+INFOJS_OPT: view:nil toc:nil ltoc:t mouse:underline buttons:0 path:http://orgmode.org/org-info.js
#+EXPORT_SELECT_TAGS: export
#+EXPORT_EXCLUDE_TAGS: noexport
#+LINK_UP:   
#+LINK_HOME: 
#+XSLT:
#+BABEL: :session *R* :cache yes :exports both :tangle yes

* Test of R

#+begin_src R :results output :export both
summary(rnorm(25))
#+end_src

#+results:

* Test of ggplot2
#+begin_src R :results output graphics :exports results :file testggplot.png
library(ggplot2)
qplot(runif(25))
#+end_src

Each code block executes fine with C-c C-c. Running C-c C-e h or C-c C-e b to export as HTML gives problems with a big clue: it writes the file testggplot.png with the contents

stat_bin: binwidth defaulted to range/30. Use 'binwidth = x' to adjust this.

My conjecture: I got a 0-length .png file above because it didn’t need to write an error message.

If I run C-c C-c first, I get a #+results[ section in the .org file with a link to testggplot.png. I can see the graph in the .org file, if I turn on iimage-mode.

If I then run C-c C-e h, I get a valid HTML file with the graph.

Does that (or the ECM) give any clues that might show me what to do (besides running C-c C-c on every code block first)?

UPDATE 2: perhaps snippets of the HTML org-mode produces provide insight.

If I have run C-c C-c first, such that the graphic file has been written, then I get

<div id="outline-container-2" class="outline-2">
<h2 id="sec-2"><span class="section-number-2">2</span> Test of ggplot2 </h2>
<div class="outline-text-2" id="text-2">


<p>
<img src="testggplot.png"  alt="testggplot.png" />
</p>







</div>
</div>

If I have not created the file first, then I get

<div id="outline-container-2" class="outline-2">
<h2 id="sec-2"><span class="section-number-2">2</span> Test of ggplot2 </h2>
<div class="outline-text-2" id="text-2">


<pre class="example">
testggplot.png
</pre>










</div>
</div>

The only difference seems to be whether it wraps the file name in a <pre> block as text or whether it wraps it as an image. Of course, in the first case, it also fails to write a .png file.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T15:10:01+00:00Added an answer on May 30, 2026 at 3:10 pm

    I have no problems with your test.org example.

    First, you are using a pretty old version of org-mode. My version is 7.8… (Org-mode version 7.8.03 (release_7.8.03.484.ge4ac3)).

    Second, please note that the syntax for setting (buffer-wide) header arguments has changed. It is no longer #+BABEL etc. See “Header arguments in Org mode properties” for more information. In your case it would look like

    # Babel settings
    #+PROPERTY: session *R*
    #+PROPERTY: cache yes 
    #+PROPERTY: exports both
    #+PROPERTY: tangle yes
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a fairly simple block of code. Sub Run(Name) on error resume next
I have a txt file which contains a google adsense code block and I'm
I have a problem with this very simple block of code. please give me
In Objective-C, I have a simple block of code that increments a counter each
I have following Code Block Which I tried to optimize in the Optimized section
When i have a code block static void Main() { foreach (int i in
I need syntax help with the following code logic: I have a code block
I have the following code block in my xslt; <xsl:when test=StatusData/Status/Temperature > 27> <td
I have a small code block that should append text to the beg of
I have the following two code blocks. Code block 1 var checkboxes = $(div.c1

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.