bugGNU Octave - Bugs: bug #30036, Scatter plot does not honor color...

 
 

bug #30036: Scatter plot does not honor color settings

Submitted by:  Beat Fasel <tuxo>
Submitted on:  Wed 02 Jun 2010 11:40:27 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: None
Originator Name: TuxoOpen/Closed: Closed
Release: 3.2.3Operating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Mon 07 Jun 2010 08:23:59 PM UTC, comment #4:

The [] syntax must be broken in 3.2.2 because it works fine on the development version.

I also tested Ben's patch and it seems to work fine.

Rik <rik5>
Project Administrator
Fri 04 Jun 2010 08:52:01 AM UTC, comment #3:

Thanks a lot, Ben and Rik.

First regarding the alternative way for changing the color as proposed by Rik: scatter(1:100,1:100,[],'r') instead of scatter(1:100,1:100,'r'). This works in octave 3.0.5, but in octave 3.2.2, I get the following error:

>> scatter(1:100,1:100,[],'r')

error: invalid value for array property "cdata"
error: called from:
error: /usr/share/octave/3.2.2/m/plot/__scatter__.m at line 127, column 5
error: /usr/share/octave/3.2.2/m/plot/scatter.m at line 70, column 7

Furthermore, I tried to patch scatter.m contained in the image toolbox 1.0.10 used in conjunction with octave version 3.2.2:

cp /usr/share/octave/3.2.2/m/plot/scatter.m .
patch scatter.m changeset.patch
patching file scatter.m
Hunk #1 FAILED at 1.
1 out of 1 hunk FAILED -- saving rejects to file scatter.m.rej
can't find file to patch at input line 22
Perhaps you should have used the -p or --strip option?
The text leading up to this was:
--------------------------
|diff -r f5f9bc8e83fc -r 542eee355720 scripts/plot/private/__scatter__.m
|--- a/scripts/plot/private/__scatter__.m Sun May 30 13:45:50 2010 -0700
|+++ b/scripts/plot/private/__scatter__.m Wed Jun 02 20:17:16 2010 -0400
--------------------------
File to patch:

Did I patch the wrong scatter.m version?

Thanks again!

Beat Fasel <tuxo>
Thu 03 Jun 2010 12:20:42 AM UTC, comment #2:

I had a few minutes to spare. I haven't done much testing, but the attached changeset works for the examples I looked at.

(file #20680)

Ben Abbott <bpabbott>
Project Member
Wed 02 Jun 2010 07:34:01 PM UTC, comment #1:

I think this may be a difference between Octave and Matlab calling conventions for scatter. According to the documentation, the correct way to set the color is to call scatter (X, Y, S, C) where S is the size of the markers and C is the color string.

For your plot,
scatter(1:100,1:100,[],'r') works just fine. I have used [] for the marker size to let Octave pick its default.

Does this work for you?

Rik <rik5>
Project Administrator
Wed 02 Jun 2010 11:40:27 AM UTC, original submission:

In both Octave and Matlab, scatter(1:100,1:100) delivers a plot with blue colored data points.

However, it is impossible to change color in Octave. For instance, scatter(1:100,1:100,'r') would deliver red colored data points in Matlab, while in Octave color is not affected and stays blue.

Beat Fasel <tuxo>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #20680:  changeset.patch added by bpabbott (3KiB - application/octet-stream - version 1)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by bpabbott (Updated the item)
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by tuxo (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 11 Jun 2010 08:40:05 PM UTCrik5Open/ClosedOpen=>Closed
    Thu 10 Jun 2010 11:18:12 PM UTCbpabbottStatusReady For Test=>Fixed
    Fri 04 Jun 2010 05:03:28 AM UTCrik5StatusNeed Info=>Ready For Test
    Thu 03 Jun 2010 12:20:42 AM UTCbpabbottAttached File-=>Added changeset.patch, #20680
    Wed 02 Jun 2010 07:34:01 PM UTCrik5StatusNone=>Need Info

    Back to the top


    Powered by Savane 3.1-cleanup1