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.

Hi, Really great work it’s an amazing tool. I managed to make the contour example work and one of my contour plot also. But when I switch the plot to contourf (wich is ok with my plt.show()), mplleaflet crashes with this error :

Traceback (most recent call last):
  File "readnc_kb.py", line 37, in <module>
    mplleaflet.show(path='test.html')
  File "/usr/lib/python2.7/site-packages/mplleaflet/_display.py", line 180, in show
    save_html(fig, fileobj=f, **kwargs)
  File "/usr/lib/python2.7/site-packages/mplleaflet/_display.py", line 131, in save_html
    html = fig_to_html(fig, **kwargs)
  File "/usr/lib/python2.7/site-packages/mplleaflet/_display.py", line 84, in fig_to_html
    exporter.run(fig)
  File "/usr/lib/python2.7/site-packages/mplleaflet/mplexporter/exporter.py", line 51, in run
    self.crawl_fig(fig)
  File "/usr/lib/python2.7/site-packages/mplleaflet/mplexporter/exporter.py", line 118, in crawl_fig
    self.crawl_ax(ax)
  File "/usr/lib/python2.7/site-packages/mplleaflet/mplexporter/exporter.py", line 140, in crawl_ax
    self.draw_collection(ax, collection)
  File "/usr/lib/python2.7/site-packages/mplleaflet/mplexporter/exporter.py", line 272, in draw_collection
    mplobj=collection)
  File "/usr/lib/python2.7/site-packages/mplleaflet/mplexporter/renderers/base.py", line 272, in draw_path_collection
    mplobj=mplobj)
  File "/usr/lib/python2.7/site-packages/mplleaflet/leaflet_renderer.py", line 125, in draw_path
    rings = list(iter_rings(data, pathcodes))
  File "/usr/lib/python2.7/site-packages/mplleaflet/utils.py", line 14, in iter_rings
    raise ValueError('Unrecognized code: {}'.format(code))
ValueError: Unrecognized code: Z

Any ideas ?

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:1
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
techkuzcommented, Feb 14, 2018

@jwass , please make changes in the code

3reactions
disarticulatecommented, Sep 5, 2017

Got the same error. Added this to the code to bypass it.

elif code == 'L' or code == 'Z' or code == 'S':
Read more comments on GitHub >

github_iconTop Results From Across the Web

pyplot.contourf() returns error when specified levels argument
0. I'm trying to make a contour plot in Python using the matplotlib.pyplot.contourf() function, and it works perfectly like this ...
Read more >
Contour Plot gives error - MATLAB Answers - MathWorks
With the above code I am trying to plot contours but I recieve this error. Error using contour3 (line 44). Z must be...
Read more >
matplotlib.pyplot.contourf — Matplotlib 3.6.2 documentation
contour and contourf draw contour lines and filled contours, respectively. ... It is an error to use vmin/vmax when a norm instance is...
Read more >
Contour Plots - Problem Solving with Python
In Mechanical Engineering a contour plot could show the stress gradient across part surface. Matplotlib's plt.contourf() method. Building contour plots with ...
Read more >
Neural network contour error predictor in CNC control systems
Abstract: This article presents a method for predicting contour error using artificial neural networks. Contour error is defined as the minimum distance ......
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