plotting on top of images
Ben Abbott
bpabbott at mac.com
Tue May 26 13:53:05 CDT 2009
On May 26, 2009, at 2:21 PM, John W. Eaton wrote:
> On 23-May-2009, Ben Abbott wrote:
>
> | On May 22, 2009, at 4:53 PM, John W. Eaton wrote:
> |
> | > On 22-May-2009, Søren Hauberg wrote:
> | >
> | > | Hi All
> | > |
> | > | With a recent checkout I can't seem to plot on top of images:
> | > |
> | > | A = rand (100);
> | > | [X, Y] = find (A > 0.9);
> | > | imshow (A)
> | > | hold on, plot (X, Y, 'o'), hold off
> | > |
> | > | This should produce a gray scale image just containing noise,
> but
> | > with
> | > | some red circles on top of the brightest pixels. But instead I
> get
> | > the
> | > | following error:
> | > |
> | > | "
> | > | multiplot> plot "-" binary array=100x100 scan=yx origin=(1,1)
> dx=1
> | > dy=1
> | > | using 1 title "" with image; , "-" binary format='%float64'
> | > record=1040
> | > | using ($1):($2) axes x1y1 title "" with points linestyle 2 ;
> | > |
> | > | ^
> | > | line 0: invalid command
> | >
> | > The following change avoids the problem for me, but I don't know
> | > whether it will break something else.
> | >
> | > diff --git a/scripts/plot/__go_draw_axes__.m b/scripts/plot/
> | > __go_draw_axes__.m
> | > --- a/scripts/plot/__go_draw_axes__.m
> | > +++ b/scripts/plot/__go_draw_axes__.m
> | > @@ -391,7 +391,7 @@
> | > titlespec{data_idx} = "title \"\"";
> | > usingclause{data_idx} = sprintf ("binary array=%dx%d scan=yx
> | > origin=(%.15g,%.15g) dx=%.15g dy=%.15g using %s",
> | > x_dim, y_dim, x_origin, y_origin, dx, dy, format);
> | > - withclause{data_idx} = sprintf ("with %s;", imagetype);
> | > + withclause{data_idx} = sprintf ("with %s", imagetype);
> | >
> | > else
> | > ximg_data{++ximg_data_idx} = img_data;
> | >
> | >
> | > jwe
> |
> | I've encountered semicolons in other places that had similar
> effects.
> | My solution was the same as what you've proposed.
>
> The semicolon in question seems to have been added in this changeset:
>
> http://hg.savannah.gnu.org/hgweb/octave/rev/3c7a36f80972
>
> Was there a reason for adding it earlier?
>
> jwe
While I don't recall the details, I have a test script related to that
changeset. It is attached.
Presently, it fails for me with and without the semicolon (but
slightly differently). I've attached the gnuplot errors as well.
Ben
-------------- next part --------------
A non-text attachment was scrubbed...
Name: multiplot.m
Type: application/octet-stream
Size: 88 bytes
Desc: not available
Url : https://www-old.cae.wisc.edu/pipermail/bug-octave/attachments/20090526/02873bbd/attachment.obj
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: results.txt
Url: https://www-old.cae.wisc.edu/pipermail/bug-octave/attachments/20090526/02873bbd/attachment.txt
-------------- next part --------------
More information about the Bug-octave
mailing list