[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #41819] Plot function misdraws plots given an
From: |
Allan Jacobs |
Subject: |
[Octave-bug-tracker] [bug #41819] Plot function misdraws plots given an 'x' in plot fmt argument. |
Date: |
Mon, 10 Mar 2014 00:20:58 +0000 |
User-agent: |
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:27.0) Gecko/20100101 Firefox/27.0 |
URL:
<http://savannah.gnu.org/bugs/?41819>
Summary: Plot function misdraws plots given an 'x' in plot
fmt argument.
Project: GNU Octave
Submitted by: allanjacobs
Submitted on: Mon 10 Mar 2014 12:20:57 AM GMT
Category: Plotting with OpenGL
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Regression
Status: None
Assigned to: None
Originator Name: allanjacobs
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Release: dev
Operating System: GNU/Linux
_______________________________________________________
Details:
$ octave --version
GNU Octave, version 4.1.0+
Source code pulled, compiled, and installed on March 9, 2014. The input data
and a screenshot are attached. I'll attach a screenshot using 3.6.4 later.
Changing the fmt from 'rx' to 'ro' yields a plot which looks correct. The
badness with 'rx' stems from drawing the back stroke of the 'X' ('') in a
position different from the forward stroke ('/').
function plotData(x, y)
%PLOTDATA Plots the data points x and y into a new figure
% PLOTDATA(x,y) plots the data points and gives the figure axes labels of
% population and profit.
% ====================== YOUR CODE HERE ======================
% Instructions: Plot the training data into a figure using the
% "figure" and "plot" commands. Set the axes labels using
% the "xlabel" and "ylabel" commands. Assume the
% population and revenue data have been passed in
% as the x and y arguments of this function.
%
% Hint: You can use the 'rx' option with plot to have the markers
% appear as red crosses. Furthermore, you can make the
% markers larger by using plot(..., 'rx', 'MarkerSize', 10);
figure; % open a new figure window
plot(x, y, 'rx', 'MarkerSize', 10); % Plot the data
ylabel('Profit in $10,000s'); % Set the y-axis label
xlabel('Population of City in 10,000s'); % Set the x-axis label
% ============================================================
end
data = load('ex1data1.txt');
X = data(:, 1); y = data(:, 2);
m = length(y); % number of training examples
plotData(X, y);
_______________________________________________________
File Attachments:
-------------------------------------------------------
Date: Mon 10 Mar 2014 12:20:57 AM GMT Name: ex1data1.txt Size: 1kB By:
allanjacobs
<http://savannah.gnu.org/bugs/download.php?file_id=30839>
-------------------------------------------------------
Date: Mon 10 Mar 2014 12:20:57 AM GMT Name: badx.png Size: 15kB By:
allanjacobs
<http://savannah.gnu.org/bugs/download.php?file_id=30840>
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?41819>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [Octave-bug-tracker] [bug #41819] Plot function misdraws plots given an 'x' in plot fmt argument.,
Allan Jacobs <=
- [Octave-bug-tracker] [bug #41819] Plot function misdraws plots given an 'x' in plot fmt argument., Allan Jacobs, 2014/03/09
- [Octave-bug-tracker] [bug #41819] Plot function misdraws plots given an 'x' in plot fmt argument., Daniel, 2014/03/11
- [Octave-bug-tracker] [bug #41819] Plot function misdraws plots given an 'x' in plot fmt argument., Daniel, 2014/03/11
- [Octave-bug-tracker] [bug #41819] Plot function misdraws plots given an 'x' in plot fmt argument., Jordi GutiƩrrez Hermoso, 2014/03/12
- [Octave-bug-tracker] [bug #41819] Plot function misdraws plots given an 'x' in plot fmt argument., Allan Jacobs, 2014/03/13
- [Octave-bug-tracker] [bug #41819] Qt plotting toolkit anti-aliasing support lacking on some graphics cards, Mike Miller, 2014/03/13
- [Octave-bug-tracker] [bug #41819] Qt plotting toolkit anti-aliasing support lacking on some graphics cards, Mike Miller, 2014/03/13
- [Octave-bug-tracker] [bug #41819] Qt plotting toolkit anti-aliasing support lacking on some graphics cards, Daniel, 2014/03/13
- [Octave-bug-tracker] [bug #41819] Qt plotting toolkit anti-aliasing support lacking on some graphics cards, Mike Miller, 2014/03/13