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.

Spot an error of mplstereonet while using Google Colab

See original GitHub issue

Hi @joferkington, I just tried the code of basic usage in Google Colab 2 weeks ago and it succeeded, but when I re-try to plot in Google Colab again, I spot an error that I couldn’t solve. It’s related to code: ax = fig.add_subplot(111, projection='stereonet'). The error is as follows:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-13-5f249805830b> in <module>()
      3 
      4 fig = plt.figure()
----> 5 ax = fig.add_subplot(111, projection='stereonet')
      6 
      7 strike, dip = 315, 30

11 frames
/usr/local/lib/python3.6/dist-packages/mplstereonet/stereonet_transforms.py in transform_non_affine(self, ll)
     69     _inverse_type = 'BaseInvertedTransform'
     70     def transform_non_affine(self, ll):
---> 71         longitude = ll[:, 0:1]
     72         latitude  = ll[:, 1:2]
     73         clong = self._center_longitude

TypeError: tuple indices must be integers or slices, not tuple

I also attached my Colab notebook to you, link here. Is there something wrong or missing in my codes? Looking forward for your help 😃

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
joferkingtoncommented, Jul 19, 2020

As other folks mentioned, this has been fixed in master for quite awhile, but things were long overdue for a release. v0.6 includes fixes for this, among other things, so a default pip install should work now. To upgrade to the current release, you can do either pip install 'mplstereonet==0.6.0' or pip install --upgrade mplstereonet

1reaction
robgeotechcommented, May 7, 2020

@yohanesnuwara I had the same issue in Jupyter notebook (with Anacondo) after updating versions of Matplotlib (from 3.1.1 to 3.1.2) and Numpy. Updating to the development version of mplstereonet as referenced in another issue (https://github.com/joferkington/mplstereonet/issues/16#issuecomment-275771610) seemed to solve the problem.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I avoid format errors using matplotlib in Google Colab?
Code error I am trying to plot time series data from a csv in google Colab and am getting the following error:.
Read more >
04.03-Errorbars.ipynb - Colaboratory - Google Colab
Suppose I augment this information with reported uncertainties: the current literature suggests a value of around 71 $\pm$ 2.5 (km/s)/Mpc, and my method...
Read more >
visualization — Blog - Agile Scientific
I wondered what a comparison plot for the various regressors in Scikit-Learn would look ... The small numbers in each plot are RMS...
Read more >
conda-forge feedstocks | community driven packaging for conda
packages on conda-forge ... google-cloud-bigquery: google-cloud-bigquery-feedstock · google-colab: google-colab-feedstock · google-cloud-firestore: ...
Read more >
Matplot Horizontal Axis Problem in Google Colab?
Below code is going to plot temperature values in Colab by matplot library. Although code is working, horizontal axis values (dates) can not ......
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