[Matplotlib-users] streamplot: vectors not pointing in the right direction!

2015-05-21 Thread Gabriele Brambilla
Hi, I have problems with streamplot I want to use a 3d vector field in coordinates (x,y,z) stored in a numpy array, and plot slices of it with streamplot. To test it I wanted to use a vector field with arrows pointed up in the z>0 region and pointed down in the z<0 region. import numpy as

Re: [Matplotlib-users] Confused about rgb_to_hsv and hsv_to_rgb

2015-05-21 Thread Eric Firing
On 2015/05/21 11:28 AM, Matteo Niccoli wrote: > OK, I understand. > > > Could you suggest a way to reduce that 3D array to a 2D array and plot it > with a specific colormap, while preserving the shading? It looks like you will get what you want by following the titusjan's advice in his reply. If

Re: [Matplotlib-users] Confused about rgb_to_hsv and hsv_to_rgb

2015-05-21 Thread Matteo Niccoli
OK, I understand. Could you suggest a way to reduce that 3D array to a 2D array and plot it with a specific colormap, while preserving the shading? I did something similar in Matlab https://mycarta.wordpress.com/2012/04/05/visualization-tips-for-geoscientists-matlab-part-ii/ But it took using

Re: [Matplotlib-users] Confused about rgb_to_hsv and hsv_to_rgb

2015-05-21 Thread Eric Firing
On 2015/05/21 5:50 AM, Matteo Niccoli wrote: > I posted a question on stackoverflow about creating with making my own > shading effect (I want to use horizontal gradient for the shading). > http://stackoverflow.com/questions/30310002/issue-creating-map-shading-in-matplotlib-imshow-by-setting-opacit

Re: [Matplotlib-users] Fixing axes for imshow plot on top of a figure

2015-05-21 Thread Benjamin Root
I think you want figimage(): http://matplotlib.org/examples/pylab_examples/figimage_demo.html I use it all the time for adding the company's logo to graphs. Keep in mind that it will plot the unsampled version of the image, so the final result depends on the figure size and resolution. I hope tha

Re: [Matplotlib-users] Fixing axes for imshow plot on top of a figure

2015-05-21 Thread Goyo
I do not think fig.add_axes([0.1, 1, 1, 1]) makes any sense. The docstring says: fig.add_axes(*args, **kwargs) Add an axes at position *rect* [*left*, *bottom*, *width*, *height*] where all quantities are in fractions of figure width and height. If bottom and height are both 1 you need the heigh

[Matplotlib-users] Confused about rgb_to_hsv and hsv_to_rgb

2015-05-21 Thread Matteo Niccoli
I posted a question on stackoverflow about creating with making my own shading effect (I want to use horizontal gradient for the shading). http://stackoverflow.com/questions/30310002/issue-creating-map-shading-in-matplotlib-imshow-by-setting-opacity-to-data-gradi Unfortunately I cannot share the

Re: [Matplotlib-users] How to plot a 2d streamline in 3d view in matplotlib

2015-05-21 Thread Benjamin Root
Sorry, it is "line_collection_2d_to_3d()". On Thu, May 21, 2015 at 12:02 PM, Raj Kumar Manna wrote: > Its giving a error, > > art3d.linecollection_2d_to_3d(stream.lines) > AttributeError: 'module' object has no attribute 'linecollection_2d_to_3d' > > > > Here is my script, > > > import matplotli

Re: [Matplotlib-users] How to plot a 2d streamline in 3d view in matplotlib

2015-05-21 Thread Raj Kumar Manna
Its giving a error, art3d.linecollection_2d_to_3d(stream.lines) AttributeError: 'module' object has no attribute 'linecollection_2d_to_3d' Here is my script, import matplotlib.pyplot as plt from matplotlib.patches import Circle, PathPatch from mpl_toolkits.mplot3d import Axes3D import mpl_too

Re: [Matplotlib-users] How to plot a 2d streamline in 3d view in matplotlib

2015-05-21 Thread Benjamin Root
(keeping the discussion on the mailing list) The object you get back have two attributes: "lines" and "arrows". This is just psuedo-code, but it would look something like this: ``` stream = ax.streamplot(..) art3d.linecollection_2d_to_3d(stream.lines, ) for p in stream.arrows: art3d.p

Re: [Matplotlib-users] How to plot a 2d streamline in 3d view in matplotlib

2015-05-21 Thread Benjamin Root
Well, there is the new 3D quiver feature: http://matplotlib.org/examples/mplot3d/quiver3d_demo.html. Not quite streamlines, but it might do in a pinch. Another approach: There is the 2d streamplot() function that returns a specialized object. >From the docstring: ``` Returns: *stream_

[Matplotlib-users] How to plot a 2d streamline in 3d view in matplotlib

2015-05-21 Thread Raj Kumar Manna
Hi, I need to plot a 2d streamline in 3d view like this . As suggested by the post , I need to extract streaml