Re: [Matplotlib-users] How to plot other than rectangular grid?

2014-11-20 Thread Thomas Caswell
There are also triangular mesh plotting (I think tricolormesh is the
function name).

The really brute force solution is to use poly collection and draw what
ever shape you want.

Tom
--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] How to plot other than rectangular grid?

2014-11-20 Thread Maria Liukis
Hello,

I have a problem plotting data which is defined on a grid other than 
rectangular mesh, and would greatly appreciate any advise. My data is defined 
for 0.1degree grid for the state of California, and I don’t want to interpolate 
my data outside of the defined grid when plotting it. I used pcolormesh() 
function for rectangular area maps, but it only accepts rectangular grid and I 
was wondering if there is a simple solution to my problem.

The only solution I could find was to use scipy.interpolate,griddata() to “map” 
my grid to a bounding rectangular grid (bounding rectangle around CA state), 
but that would also interpolate my data to grid cells outside of CA state, 
which I don’t want to do.

Many thanks for any hints!
Masha
--
liu...@usc.edu




--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Single color transparent colormap

2014-11-20 Thread Eric Firing
On 2014/11/19, 1:03 PM, Benjamin Root wrote:
> What you are seeing is the fact that the adjacent cells share the same
> coordinates, so neighboring cells overlap by one pixel. This is only
> visible when alpha != 1. This is a tricky issue to solve, but I could
> have sworn we made some progress on that front by setting "snap" to
> False somewhere. There have been past discussions about it, for sure...

I don't think we ever made any progress; it seems like a problem with 
the renderer itself, agg in this case, and one that differs from one 
renderer to another (e.g., if the plot is saved as pdf and then rendered 
by different libraries).  Try turning off antialiasing.

Eric

>
> Ben Root
>
> On Wed, Nov 19, 2014 at 12:57 PM, Loïc Estève  > wrote:
>
> Thanks for the suggestions, I have tried the easiest one for now,
> namely pcolormesh, see attached plot. The alpha colormap look great
> but I can't seem to figure out how to prevent the edges of the cells
> from being visible. I tried using edgecolors='none' to no avail. I
> guess retrospectively that is similar to the lines we see in the
> colormap on the right.
>
> The snippet I am using:
>
> import numpy as np
>
> import matplotlib.pyplot as plt
> from matplotlib.colors import LinearSegmentedColormap
>
> import matplotlib
>
> matplotlib.rcParams['figure.__facecolor'] = 'white'
>
> cm_dict = {'red':  ((0.0, 1.0, 1.0),
>  (1.0, 1.0, 1.0)),
> 'green': ((0.0, 0.0, 0.0),
>   (1.0, 0.0, 0.0)),
> 'blue':  ((0.0, 0.0, 0.0),
>   (1.0, 0.0, 0.0)),
> 'alpha': ((0.0, 0.0, 0.0),
>   (1.0, 1.0, 1.0))
>}
>
> my_cm = LinearSegmentedColormap('my___cm', cm_dict)
>
> vals = np.tile(np.linspace(-1, 1, 30), (20, 1))
>
> fig = plt.figure()
> ax = plt.pcolormesh(vals, cmap=my_cm)
> plt.colorbar()
> plt.show()
>
> Cheers,
> Loïc
>
>
>
>
> --
> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
> with Interactivity, Sharing, Native Excel Exports, App Integration & more
> Get technology previously reserved for billion-dollar corporations, FREE
> http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
>
>
>
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>


--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] aligning plot width with imshow/contour width

2014-11-20 Thread Ken Mankoff
I'm using mpl 1.4.2.

I posted this question onto StackOverflow and got a nice reply/tutorial.
https://stackoverflow.com/questions/26985210/

Thanks,

  -k.
--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users