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.

raster trace type: matplotlib imshow equivalent

See original GitHub issue

Could/should we have some trace type that would be equivalent to matplotlib’s imshow() for showing full-color images? https://matplotlib.org/api/_as_gen/matplotlib.pyplot.imshow.html

basically heatmap but with r,g,b channels or something?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:6
  • Comments:14 (12 by maintainers)

github_iconTop GitHub Comments

4reactions
YoniChechikcommented, Aug 21, 2019

@antoinerg , I think that a good line to follow is matplotlib.pyplot.imshow. Key functions not to be missed IMHO are:

  • labeling (data on hover)
  • aspect ratio! it’s very hard to set with bokeh the original image aspect ratio, or “equal” ratio, if needed.
  • [0,0] origin: matlab and matplotlib both uses the origin as upper-left, which has since became standard.
  • 2D and 3D (or 4D) input: 2D input should be like heatmap, with easy ability to change color limit min and max (default is data min and max). 3D/4D (RGB/A) input should be default to np.uint8 ([0,255]) or other types which will be in range [0,1].
  • input array: must be able to take np.array and list of lists.
3reactions
alexcjohnsoncommented, May 23, 2019

I’m for it - I really like the idea of being able to specify 3 (or 2 or 4) 2D arrays and specifying whether they’re RGB, HSV, HSL, or whatever. I had some instances in grad school of multiple independent 2D channels of data I wanted to overlay… never did find a mapping that was intelligible for 3 channels but for 2 channels either R+G, R+B, or L+H worked fairly well in my case.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Imshow in Python - Plotly
This tutorial shows how to display and explore image data. If you would like instead a logo or static image, use go.layout.Image as...
Read more >
matplotlib.pyplot.imshow — Matplotlib 3.6.2 documentation
Display data as an image, i.e., on a 2D regular raster. The input may either be actual RGB(A) data, or 2D scalar data,...
Read more >
Chapter 4. Visualization with Matplotlib - O'Reilly
Matplotlib is a multiplatform data visualization library built on NumPy arrays, and designed to work with the broader SciPy stack. It was conceived...
Read more >
15-visualising-data
Matplotlib as an object oriented plotting library. Pylab is an interface to the same set of functions that imitates the (state-driven) Matlab plotting...
Read more >
Introduction to Geospatial Raster and Vector Data with Python
This episode introduces the two primary types of geospatial data: rasters and ... in python as a DataArray type, we can plot this...
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