Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add errorbars to mplot3d #8031

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 36 commits into from
Aug 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
66cbdf6
add minimal errorbar3d method to Axes3D
vlas-sokolov Jan 3, 2017
d8e4d57
for now it's wiser to rely on LineCollection styling
vlas-sokolov Jan 3, 2017
2d32dfe
type in autorange
vlas-sokolov Jan 3, 2017
8e66193
fix for auto-scaling NaN values
vlas-sokolov Jan 4, 2017
d377942
add caplines
vlas-sokolov Jan 5, 2017
9b1de1f
add barsabove option; refactor plotting kwargs
vlas-sokolov Jan 5, 2017
c7fc68a
fix for missing zorder in kwargs
vlas-sokolov Jan 5, 2017
ef5699c
add upper/lower limits
vlas-sokolov Feb 6, 2017
d4f67c2
add extended formatting from the 2d case; clean-up
vlas-sokolov Feb 6, 2017
3b3e5d4
pep8 edits
vlas-sokolov Feb 6, 2017
6889a3d
fix errorevery; return a container of sorts
vlas-sokolov Feb 7, 2017
20f0caf
allow offsets for errorevery
vlas-sokolov Feb 7, 2017
cd63593
arrrr pep8 again
vlas-sokolov Feb 7, 2017
fb2d200
docstring edits
vlas-sokolov Feb 9, 2017
74f5209
add example; update what's new section
vlas-sokolov Feb 9, 2017
82dec2b
please just squash everything - I can't pep8 properly
vlas-sokolov Feb 9, 2017
c570c69
vim adds a newline behind the scenes already
vlas-sokolov Feb 9, 2017
c30c276
rebase against current master + fix dropped deprecations
Apr 16, 2020
f5ef8bd
fix compatibility issues with 2d errorbar version (WIP)
Apr 17, 2020
c3fa542
fix flake8 warnings, mirror naming/docstring style of other examples
Apr 22, 2020
b86260a
fix failing sphinx docs
Apr 23, 2020
45cbc81
add an image comparison unit test for 3d errorbars
Apr 24, 2020
42c1d27
errline gets drawn when both limits are set (compat. reasons)
Apr 30, 2020
5969893
refactor to use art3d.get_dir_vector instead of np.roll
May 1, 2020
26a4226
adapt 2d errorbar containers for legend handling
May 6, 2020
c8f1161
need to consider everymask for altering upper=lower limits
May 6, 2020
e18713a
switch to plt.quiver for drawling arrows
May 13, 2020
159b6b5
refactor numpy array handling
May 13, 2020
5db6976
allow for (2, N)-shaped errorbar input + small numpy refactors
May 13, 2020
3c7c0de
add numpy refactor as per PR suggestion
vlas-sokolov May 14, 2020
3a99be8
add numpy refactror for errorbar3d example
vlas-sokolov May 20, 2020
1a6f58a
add numpy refactor for errorbar3d unit test
May 20, 2020
05f4776
Merge branch 'master' into errorbars-mplot3d
vlas-sokolov Jun 10, 2020
0d8c3e3
port most of the changes done in #15037 for 2d errorbars
Jun 18, 2020
93c9de5
Apply suggestions from code review
vlas-sokolov Jul 26, 2020
1c73204
fix more pr comments
Jul 29, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions doc/users/whats_new/errorbars_3d.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Errorbar method for mplot3d
---------------------------

The errorbar function :meth:`matplotlib.axes._axes.Axes.errorbar` is ported
into the `mplot3d` framework in its entirety. Supports features such as custom
styling for error lines and cap marks, control over erorrbar spacing, upper and
lower limit marks.
30 changes: 30 additions & 0 deletions examples/mplot3d/errorbar3d.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
"""
============
3D errorbars
============

An example of using errorbars with upper and lower limits in mplot3d.
"""

import matplotlib.pyplot as plt
import numpy as np

fig = plt.figure()
ax = fig.gca(projection='3d')

# setting up a parametric curve
t = np.arange(0, 2*np.pi+.1, 0.01)
x, y, z = np.sin(t), np.cos(3*t), np.sin(5*t)

estep = 15
i = np.arange(t.size)
zuplims = (i % estep == 0) & (i // estep % 3 == 0)
zlolims = (i % estep == 0) & (i // estep % 3 == 2)

ax.errorbar(x, y, z, 0.2, zuplims=zuplims, zlolims=zlolims, errorevery=estep)

ax.set_xlabel("X label")
ax.set_ylabel("Y label")
ax.set_zlabel("Z label")

plt.show()
Loading