question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support size (N,1) numpy arrays where 1D arrays are supported

See original GitHub issue

When I create my graphic using the online servers everything looks great. If I use the same commands but switch to the offline.plot function, only part of my figure is correctly drawn. If I then click the “export to plot.ly” button at the bottom, everything appears normal. There are no errors in my console. I tried this with Google Chrome and Firefox. I’m using version 2.0.2 of plotly.py.

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
alexfeldcommented, Feb 24, 2017

No problem! Sorry it took me so long. This issue arises when using plotly in a scientific setting. Often you are working with column vectors for mathematical reasons. This behavior would be confusing in that context, especially if you are used to using matplotlib.

0reactions
cldouglcommented, Feb 24, 2017

Thanks for taking the time to include that example @alexfeld ! Can you let me know the reasoning/use case for passing x = np.random.uniform(-3.,3.,(20,1)) rather than x = np.random.uniform(-3.,3.,20)? For scatter plots, x and y should be 1 dimensional.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Indexing on ndarrays — NumPy v1.25.dev0 Manual
ndarrays can be indexed using the standard Python x[obj] syntax, where x is the array and obj the selection. There are different kinds...
Read more >
Why Numpy has dimension (n,) instead of (n,1) only [duplicate]
Having "rows" and "columns" is a highly specialized context for array operations—but yes, a very common one: that's why numpy also supplies the ......
Read more >
NumPy Array Shape - W3Schools
The shape of an array is the number of elements in each dimension. Get the Shape of an Array. NumPy arrays have an...
Read more >
1.4.1. The NumPy array object - Scipy Lecture Notes
extension package to Python for multi-dimensional arrays ... len(b) # returns the size of the first dimension ... a = np.arange(10) # 0...
Read more >
Python | Broadcasting with NumPy Arrays - GeeksforGeeks
The two arrays are compatible in a dimension if they have the same size in the dimension or if one of the arrays...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found