<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
  <channel>
    <title>MaplePrimes - answers and comments on Question, external image as background in 2d plot </title>
    <link>http://www.mapleprimes.com/questions/35560-External-Image-As-Background-In-2d-Plot-</link>
    <language>en-us</language>
    <copyright>2026 Maplesoft, A Division of Waterloo Maple Inc.</copyright>
    <generator>Maplesoft Document System</generator>
    <lastBuildDate>Sat, 13 Jun 2026 02:27:11 GMT</lastBuildDate>
    <pubDate>Sat, 13 Jun 2026 02:27:11 GMT</pubDate>
    <itunes:subtitle />
    <itunes:summary />
    <description>The latest answers and comments added to the Question, external image as background in 2d plot </description>
    <image>
      <url>http://www.mapleprimes.com/images/mapleprimeswhite.jpg</url>
      <title>MaplePrimes - answers and comments on Question, external image as background in 2d plot </title>
      <link>http://www.mapleprimes.com/questions/35560-External-Image-As-Background-In-2d-Plot-</link>
    </image>
    <item>
      <title>Background image</title>
      <link>http://www.mapleprimes.com/questions/35560-External-Image-As-Background-In-2d-Plot-?ref=Feed:MaplePrimes:external image as background in 2d plot :Comments#answer44265</link>
      <itunes:summary>&lt;p&gt;You can import images into Maple to view, but they can't be used as a background for a plot.&lt;br /&gt;
I apologize for this inconenience.&lt;/p&gt;
&lt;p&gt;Jonny&lt;br /&gt;
Maplesoft Technical Support Analyst&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;You can import images into Maple to view, but they can't be used as a background for a plot.&lt;br /&gt;
I apologize for this inconenience.&lt;/p&gt;
&lt;p&gt;Jonny&lt;br /&gt;
Maplesoft Technical Support Analyst&lt;/p&gt;</description>
      <guid>44265</guid>
      <pubDate>Tue, 09 Mar 2010 23:54:08 Z</pubDate>
      <itunes:author>jzivku</itunes:author>
      <author>jzivku</author>
    </item>
    <item>
      <title>listdensityplot</title>
      <link>http://www.mapleprimes.com/questions/35560-External-Image-As-Background-In-2d-Plot-?ref=Feed:MaplePrimes:external image as background in 2d plot :Comments#answer44271</link>
      <itunes:summary>&lt;p&gt;For a 2-d plot (of a monochrome image), you can try listdensityplot:&lt;/p&gt;
&lt;pre&gt;
&amp;gt; plots:-listdensityplot(immy,style=patchnogrid);
&lt;/pre&gt;
&lt;p&gt;(you may want to rotate that 90 degrees clockwise).&lt;/p&gt;
&lt;p&gt;Unfortunately listdensityplot doesn't allow an m * n * 3 Array which you would get from a colour image, but you could use listdensityplot on one of the colour components.&lt;/p&gt;
&lt;p&gt;Also this might not work very well on big images, especially in Standard GUI.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Thus: &lt;/p&gt;
&lt;pre&gt;
&amp;gt; immy:=ImageTools:-Read(
       &amp;quot;c:/Program Files/Maple 13.02/data/images/tree.jpg&amp;quot;):
&amp;nbsp;&amp;nbsp; reds:= immy(..,..,1);
&amp;nbsp;&amp;nbsp; plottools[rotate](plots[listdensityplot](reds,
      style=patchnogrid), -Pi/2);

&lt;/pre&gt;
&lt;p&gt;&lt;span&gt;&lt;a href="http://www.mapleprimes.com/viewfile/4213"&gt;&lt;img src="http://www.mapleprimes.com/scripts/image.php?image=http://www.mapleprimes.com/files/4541_tree.jpg&amp;amp;width=300&amp;amp;height=300" alt="" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;For a 2-d plot (of a monochrome image), you can try listdensityplot:&lt;/p&gt;
&lt;pre&gt;
&amp;gt; plots:-listdensityplot(immy,style=patchnogrid);
&lt;/pre&gt;
&lt;p&gt;(you may want to rotate that 90 degrees clockwise).&lt;/p&gt;
&lt;p&gt;Unfortunately listdensityplot doesn't allow an m * n * 3 Array which you would get from a colour image, but you could use listdensityplot on one of the colour components.&lt;/p&gt;
&lt;p&gt;Also this might not work very well on big images, especially in Standard GUI.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Thus: &lt;/p&gt;
&lt;pre&gt;
&amp;gt; immy:=ImageTools:-Read(
       &amp;quot;c:/Program Files/Maple 13.02/data/images/tree.jpg&amp;quot;):
&amp;nbsp;&amp;nbsp; reds:= immy(..,..,1);
&amp;nbsp;&amp;nbsp; plottools[rotate](plots[listdensityplot](reds,
      style=patchnogrid), -Pi/2);

&lt;/pre&gt;
&lt;p&gt;&lt;span&gt;&lt;a href="http://www.mapleprimes.com/viewfile/4213"&gt;&lt;img src="http://www.mapleprimes.com/scripts/image.php?image=http://www.mapleprimes.com/files/4541_tree.jpg&amp;amp;width=300&amp;amp;height=300" alt="" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;</description>
      <guid>44271</guid>
      <pubDate>Wed, 10 Mar 2010 13:14:34 Z</pubDate>
      <itunes:author>Robert Israel</itunes:author>
      <author>Robert Israel</author>
    </item>
    <item>
      <title>How we can change the</title>
      <link>http://www.mapleprimes.com/questions/35560-External-Image-As-Background-In-2d-Plot-?ref=Feed:MaplePrimes:external image as background in 2d plot :Comments#answer44272</link>
      <itunes:summary>&lt;p&gt;How we can change the background plot, as shown in this picture?&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;&lt;img alt="" src="http://www.mapleprimes.com/files/9494_background2dplot.jpg" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;Gracias&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;How we can change the background plot, as shown in this picture?&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;&lt;img alt="" src="http://www.mapleprimes.com/files/9494_background2dplot.jpg" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;Gracias&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;</description>
      <guid>44272</guid>
      <pubDate>Wed, 10 Mar 2010 18:56:54 Z</pubDate>
      <itunes:author>herclau</itunes:author>
      <author>herclau</author>
    </item>
    <item>
      <title>background images (2D and 3D)</title>
      <link>http://www.mapleprimes.com/questions/35560-External-Image-As-Background-In-2d-Plot-?ref=Feed:MaplePrimes:external image as background in 2d plot :Comments#answer44274</link>
      <itunes:summary>&lt;p&gt;Here's the code to my original reply (the one that got accidentally replaced by Thomas's reply entitled "kernelopts(datadir)".&lt;/p&gt;
&lt;p&gt;It's not fast, but I'm sure it could be made faster, and smarter. The basic idea is that an image, once read into Maple, can be put up as either a 3D or a 2D plot.&lt;/p&gt;
&lt;p&gt;First the 3D plot. (Thanks, Thomas, for the datadir tip.)&lt;/p&gt;
&lt;pre&gt;restart:
a,b:=-10,10:
P1:=plots:-spacecurve([sin(t),t,10],t=a..b,color=black):
#immy:=ImageTools:-Read("/usr/local/maple10.03/data/images/phone.jpg"):
immy:=ImageTools:-Read(cat(kernelopts(datadir),"/images/phone.jpg")):
m,n:=op(map2(op,2,[rtable_dims(immy)])):
P2a:=ImageTools:-Preview(immy):
P2:=plottools:-translate(P2a,-floor(m/2),-floor(n/2),1):
P2:=plottools:-scale(P2,(b-a)/m,(b-a)/n,1):
plots:-display([P2,P1],orientation=[0.0,0.1]);
&lt;/pre&gt;
&lt;p&gt;Next, the 2D plot, using P2a from above.&lt;/p&gt;
&lt;pre&gt;Z:=op(2,op(4,op(1,P2a))):
Zc:=Array(1..265*265,1..3,(i,j)-&amp;gt;Z[265-max(1,iquo(i,265))+1,265-irem(i,265),j],datatype=float[8]):
M:=Matrix(265*265,2,datatype=float[8]):
V:=Vector(265,i-&amp;gt;265-i+1,datatype=float[8]):
Vc:=Vector(265,datatype=float[8]):
for i from 1 to 265 do
  ArrayTools:-Fill(265,i,Vc,0,1);
  M[(i-1)*265+1..(i-1)*265+265,2]:=Vc:
  M[(i-1)*265+1..(i-1)*265+265,1]:=V:
end do:
P3a:=plots:-pointplot(convert(M,listlist),color=[seq(COLOR(RGB,seq(Zc[i][k],k=1..3)),i=1..265^2)]):
P3:=plottools:-translate(P3a,-floor(m/2),-floor(n/2)):
P3:=plottools:-scale(P3,(b-a)/m,(b-a)/n):
P4:=plot(sin(x),x=a..b,color=black):
plots:-display([P3,P4]);
&lt;/pre&gt;
&lt;p&gt;Anyway, it can be done, is the essence.&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;Here's the code to my original reply (the one that got accidentally replaced by Thomas's reply entitled "kernelopts(datadir)".&lt;/p&gt;
&lt;p&gt;It's not fast, but I'm sure it could be made faster, and smarter. The basic idea is that an image, once read into Maple, can be put up as either a 3D or a 2D plot.&lt;/p&gt;
&lt;p&gt;First the 3D plot. (Thanks, Thomas, for the datadir tip.)&lt;/p&gt;
&lt;pre&gt;restart:
a,b:=-10,10:
P1:=plots:-spacecurve([sin(t),t,10],t=a..b,color=black):
#immy:=ImageTools:-Read("/usr/local/maple10.03/data/images/phone.jpg"):
immy:=ImageTools:-Read(cat(kernelopts(datadir),"/images/phone.jpg")):
m,n:=op(map2(op,2,[rtable_dims(immy)])):
P2a:=ImageTools:-Preview(immy):
P2:=plottools:-translate(P2a,-floor(m/2),-floor(n/2),1):
P2:=plottools:-scale(P2,(b-a)/m,(b-a)/n,1):
plots:-display([P2,P1],orientation=[0.0,0.1]);
&lt;/pre&gt;
&lt;p&gt;Next, the 2D plot, using P2a from above.&lt;/p&gt;
&lt;pre&gt;Z:=op(2,op(4,op(1,P2a))):
Zc:=Array(1..265*265,1..3,(i,j)-&amp;gt;Z[265-max(1,iquo(i,265))+1,265-irem(i,265),j],datatype=float[8]):
M:=Matrix(265*265,2,datatype=float[8]):
V:=Vector(265,i-&amp;gt;265-i+1,datatype=float[8]):
Vc:=Vector(265,datatype=float[8]):
for i from 1 to 265 do
  ArrayTools:-Fill(265,i,Vc,0,1);
  M[(i-1)*265+1..(i-1)*265+265,2]:=Vc:
  M[(i-1)*265+1..(i-1)*265+265,1]:=V:
end do:
P3a:=plots:-pointplot(convert(M,listlist),color=[seq(COLOR(RGB,seq(Zc[i][k],k=1..3)),i=1..265^2)]):
P3:=plottools:-translate(P3a,-floor(m/2),-floor(n/2)):
P3:=plottools:-scale(P3,(b-a)/m,(b-a)/n):
P4:=plot(sin(x),x=a..b,color=black):
plots:-display([P3,P4]);
&lt;/pre&gt;
&lt;p&gt;Anyway, it can be done, is the essence.&lt;/p&gt;</description>
      <guid>44274</guid>
      <pubDate>Wed, 10 Mar 2010 20:44:00 Z</pubDate>
      <itunes:author>pagan</itunes:author>
      <author>pagan</author>
    </item>
    <item>
      <title>Background image</title>
      <link>http://www.mapleprimes.com/questions/35560-External-Image-As-Background-In-2d-Plot-?ref=Feed:MaplePrimes:external image as background in 2d plot :Comments#comment44266</link>
      <itunes:summary>&lt;p&gt;So we can not have Fat Freddy's cat looking at a Riemannian surface ?&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;So we can not have Fat Freddy's cat looking at a Riemannian surface ?&lt;/p&gt;</description>
      <guid>44266</guid>
      <pubDate>Wed, 10 Mar 2010 00:11:44 Z</pubDate>
      <itunes:author>Axel Vogt</itunes:author>
      <author>Axel Vogt</author>
    </item>
    <item>
      <title>Background colour</title>
      <link>http://www.mapleprimes.com/questions/35560-External-Image-As-Background-In-2d-Plot-?ref=Feed:MaplePrimes:external image as background in 2d plot :Comments#comment44275</link>
      <itunes:summary>&lt;p&gt;The simplest way is to display the plot together with a solid rectangle of the appropriate size.&amp;nbsp; Regions in a display are rendered "front to back", so make&lt;br&gt; the background rectangle the last item in the display (this will only matter, I think, if there are filled regions in your plot).&amp;nbsp; Thus:&lt;/p&gt;
&lt;pre&gt;&amp;gt; P1:= plot(whatever...): 
# say for this plot x goes from x1 to x2 and y from y1 to y2 
  Background:= plottools[rectangle]([x1,y1],[x2,y2],colour=cyan):
  plots:-display([P1, Background]);

&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;The simplest way is to display the plot together with a solid rectangle of the appropriate size.&amp;nbsp; Regions in a display are rendered "front to back", so make&lt;br&gt; the background rectangle the last item in the display (this will only matter, I think, if there are filled regions in your plot).&amp;nbsp; Thus:&lt;/p&gt;
&lt;pre&gt;&amp;gt; P1:= plot(whatever...): 
# say for this plot x goes from x1 to x2 and y from y1 to y2 
  Background:= plottools[rectangle]([x1,y1],[x2,y2],colour=cyan):
  plots:-display([P1, Background]);

&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
      <guid>44275</guid>
      <pubDate>Thu, 11 Mar 2010 02:05:42 Z</pubDate>
      <itunes:author>Robert Israel</itunes:author>
      <author>Robert Israel</author>
    </item>
  </channel>
</rss>