<p>I am working on a project which plots points over a checkerboard (representing seats for people).  I would like each pixel in the image to represent each integer matrix entry.  After updating my Octave from $3.8$ to $4.2$, any image takes up $\frac 14$ of the actual plot window using the default OpenGL/ FLTK, as seen below.</p>

<p>The sample code:</p>

<pre><code>clear

A = [1,2;3,4];

image(A)

axis xy %orients to bottom left
</code></pre>

<p>I need the purple to take up the entire plot window.</p>

<p>I can plot overtop the image using the line() function and I get:</p>

<p><a href="https://i.sstatic.net/iweRz.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/iweRz.png" alt="OpenGL with Line plotted overtop"></a></p>

<p>Now, if I enter graphics_toolkit("gnuplot") into the octave command window prior to running the code then I get the correct purple image taking up the entire plot window.</p>

<p>However, if I then use the line() function under gnuplot and plot the same line as before with</p>

<pre><code>x=[0.5,2.5];
y=[1,1];
line(x,y,'color','red','linewidth',2)
</code></pre>

<p>the following bug appears:</p>

<p>multiplot> lot "-" binary format='%float64' record=2 using ($1):($2) axes x1y1 title "" with lines linestyle 10 ;
           ^
           line 0: invalid command</p>

<p>and I get the following image:</p>

<p><a href="https://i.sstatic.net/6LR2U.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/6LR2U.png" alt="Gnuplot with Line() function overtop"></a></p>

<p>Does anyone know the issue?  Thank you.</p>

CC BY-SA 3.0
2017-05-05T20:14:08.903Z
Could you provide a screenshot of what it looks like?
flawr
CC BY-SA 3.0
2017-05-09T18:53:17.833Z
@flawr  The included image, the purple should take up the entire plot window
marmar44
CC BY-SA 3.0
2017-05-09T19:09:43.983Z
I cannot reproduce your problem, when I try it the whole axis are filled. You can of course cut the axis using `xlim([a,b])` and `ylim([c,d])` or `axis([a,b,c,d])`.
flawr
CC BY-SA 3.0
2017-05-19T17:22:25.030Z
Cutting the axis works for cutting the axis, then the resulting image takes up a quarter of the new window.   If I enter graphics_toolkit("gnuplot") I get the entire axes to be filled with the purple squares like I want.  However, if I use the line( ) function to plot a line overtop I get the following error:     lot "-" binary format='%float64' record=2 using ($1):($2) axes x1y1 title "" with lines linestyle 10 ;
           ^
           line 0: invalid command
marmar44
CC BY-SA 3.0
2017-05-19T17:25:15.020Z
If I don't use gnuplot, and instead use OpenGL (which is the default), I get the same quarter plot image of purple but plotting overtop works.
marmar44
CC BY-SA 3.0
2017-05-19T17:48:07.310Z
@flawr  Please see the edited post.  Hopefully it helps and thank you very much for helping me out.
marmar44
<image-processing><matrix>
Octave matrix to image pixels too small (do not have 1 pixel per integer)
marmar44
# Octave matrix to image pixels too small (do not have 1 pixel per integer)

(Asked by: username_0 on 2017-04-24)

I am working on a project which plots points over a checkerboard (representing seats for people). I would like each pixel in the image to represent each integer matrix entry. After updating my Octave from $3.8$ to $4.2$, any image takes up $\frac 14$ of the actual plot window using the default OpenGL/ FLTK, as seen below.

The sample code:

```
clear

A = [1,2;3,4];

image(A)

axis xy %orients to bottom left

```

I need the purple to take up the entire plot window.

I can plot overtop the image using the line() function and I get:

[![OpenGL with Line plotted overtop](https://i.sstatic.net/iweRz.png)](https://i.sstatic.net/iweRz.png)

Now, if I enter graphics\_toolkit("gnuplot") into the octave command window prior to running the code then I get the correct purple image taking up the entire plot window.

However, if I then use the line() function under gnuplot and plot the same line as before with

```
x=[0.5,2.5];
y=[1,1];
line(x,y,'color','red','linewidth',2)

```

the following bug appears:

multiplot> lot "-" binary format='%float64' record=2 using ($1):($2) axes x1y1 title "" with lines linestyle 10 ;
^
line 0: invalid command

and I get the following image:

[![Gnuplot with Line() function overtop](https://i.sstatic.net/6LR2U.png)](https://i.sstatic.net/6LR2U.png)

Does anyone know the issue? Thank you.

**Tags:** image-processing, matrix

> **Comments:**
> **username_1**: Could you provide a screenshot of what it looks like?  
> **username_0**: @username_1  The included image, the purple should take up the entire plot window  
> **username_1**: I cannot reproduce your problem, when I try it the whole axis are filled. You can of course cut the axis using `xlim([a,b])` and `ylim([c,d])` or `axis([a,b,c,d])`.  
> **username_0**: Cutting the axis works for cutting the axis, then the resulting image takes up a quarter of the new window.   If I enter graphics_toolkit("gnuplot") I get the entire axes to be filled with the purple squares like I want.  However, if I use the line( ) function to plot a line overtop I get the following error:     lot "-" binary format='%float64' record=2 using ($1):($2) axes x1y1 title "" with lines linestyle 10 ;            ^            line 0: invalid command  
> **username_0**: If I don't use gnuplot, and instead use OpenGL (which is the default), I get the same quarter plot image of purple but plotting overtop works.  
> **username_0**: @username_1  Please see the edited post.  Hopefully it helps and thank you very much for helping me out.  

---

## 0 answers

