SourceForge logo
SourceForge logo
Menu

matplotlib-users

From: Matthew B. <mat...@gm...> - 2014年10月26日 06:57:42
Hi,
I just noticed that this:
>>> x = np.arange(10)
>>> y = np.zeros(10)
>>> y[5] = 1
>>> plt.bar(x, y)
Will generate a big box for x = 5 with x 0:5 and 6: stripped, whereas this:
>>> y += 0.000001
>>> plt.bar(x, y)
Will generate a bar plot going from x = 0 to 9 with a bar at 5 as I
was expecting.
If I make a zeros vector with two discontiguous 1 values, then I also
get the full x range, with two spikes.
>>> y = np.zeros(10)
>>> y[2] = 1
>>> y[5] = 1
>>> plt.bar(x, y)
Is this expected? It certainly surprised me...
Matthew
From: Benjamin R. <ben...@ou...> - 2014年10月27日 18:07:24
Which version of matplotlib are you running? I could have sworn this was
fixed awhile ago. If I understand the problem correctly, essentially, the
autoscalling was clipping empty patches out.
Ben Root
On Sun, Oct 26, 2014 at 2:57 AM, Matthew Brett <mat...@gm...>
wrote:
> Hi,
>
> I just noticed that this:
>
> >>> x = np.arange(10)
> >>> y = np.zeros(10)
> >>> y[5] = 1
> >>> plt.bar(x, y)
>
> Will generate a big box for x = 5 with x 0:5 and 6: stripped, whereas this:
>
> >>> y += 0.000001
> >>> plt.bar(x, y)
>
> Will generate a bar plot going from x = 0 to 9 with a bar at 5 as I
> was expecting.
>
> If I make a zeros vector with two discontiguous 1 values, then I also
> get the full x range, with two spikes.
>
> >>> y = np.zeros(10)
> >>> y[2] = 1
> >>> y[5] = 1
> >>> plt.bar(x, y)
>
> Is this expected? It certainly surprised me...
>
> Matthew
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Matthew B. <mat...@gm...> - 2014年10月28日 04:01:16
On Mon, Oct 27, 2014 at 11:06 AM, Benjamin Root <ben...@ou...> wrote:
> Which version of matplotlib are you running? I could have sworn this was
> fixed awhile ago. If I understand the problem correctly, essentially, the
> autoscalling was clipping empty patches out.
I'm embarrassed to say that I didn't look at my version, and now I do,
it was 1.3.1, and you are quite right, 1.4.0 (and 1.4.2) fixes that.
Thanks, and, sorry to write too quickly,
Matthew
From: Benjamin R. <ben...@ou...> - 2014年10月28日 15:55:01
No problem!
On Tue, Oct 28, 2014 at 12:00 AM, Matthew Brett <mat...@gm...>
wrote:
> On Mon, Oct 27, 2014 at 11:06 AM, Benjamin Root <ben...@ou...> wrote:
> > Which version of matplotlib are you running? I could have sworn this was
> > fixed awhile ago. If I understand the problem correctly, essentially, the
> > autoscalling was clipping empty patches out.
>
> I'm embarrassed to say that I didn't look at my version, and now I do,
> it was 1.3.1, and you are quite right, 1.4.0 (and 1.4.2) fixes that.
> Thanks, and, sorry to write too quickly,
>
> Matthew
>
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /