Discussion:
[Matplotlib-users] plot() and imshow() relationship
Amit Saha
2015-05-29 11:12:08 UTC
Permalink
Hi all,

I am trying to understand if there is a way to compare how plot() and
imshow() works for the case where I am not using imshow() to display
an image.

Via the plot() function, I am specifying the points that I want to
plot and also optionally the color that i want the points to be in.
For example, plot([1, 2, 3], [2, 3, 4], 'ro') will create a plot with
those points colored "red". Via the imshow() function, we specify the
color (or intensity) of each point and a figure is created with the
points colored accordingly. Sure, imshow() allows me to color each
point differently.

Is there a way to relate them?

Also asked on StackOverflow:
http://stackoverflow.com/questions/30527811/plot-and-imshow-relationship

Thanks,
Amit.
--
http://echorand.me

------------------------------------------------------------------------------
Paul Hobson
2015-05-29 15:50:23 UTC
Permalink
imshow is for displaying arrays as images/rasters.

plot is for showing data/functions as points and lines.

See the gallery for imshow:
http://matplotlib.org/gallery.html#images_contours_and_fields
Post by Amit Saha
Hi all,
I am trying to understand if there is a way to compare how plot() and
imshow() works for the case where I am not using imshow() to display
an image.
Via the plot() function, I am specifying the points that I want to
plot and also optionally the color that i want the points to be in.
For example, plot([1, 2, 3], [2, 3, 4], 'ro') will create a plot with
those points colored "red". Via the imshow() function, we specify the
color (or intensity) of each point and a figure is created with the
points colored accordingly. Sure, imshow() allows me to color each
point differently.
Is there a way to relate them?
http://stackoverflow.com/questions/30527811/plot-and-imshow-relationship
Thanks,
Amit.
--
http://echorand.me
------------------------------------------------------------------------------
_______________________________________________
Matplotlib-users mailing list
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Amit Saha
2015-06-17 06:30:00 UTC
Permalink
Post by Paul Hobson
imshow is for displaying arrays as images/rasters.
plot is for showing data/functions as points and lines.
http://matplotlib.org/gallery.html#images_contours_and_fields
Thanks Paul. I have since then have been able to develop a better
understanding of imshow() and it doesn't seem very sensible to try and
compare/relate it to what plot() does.
--
http://echorand.me

------------------------------------------------------------------------------
Loading...