[Matplotlib-users] Linewidths in data space?

2013-04-12 Thread Michael Wimmer
I have a collection of Patches and Lines that have their coordinates in
data space, i.e. like in the following example:


import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
import matplotlib.collections as mcollections
import matplotlib.lines as mlines

fig = plt.figure()
ax = fig.add_subplot(111)

patches = []
patches.append(mlines.Line2D((0,1),(0,1), linewidth=1))
patches.append(mpatches.Circle((0,0), 0.25, linewidth=1))
patches.append(mpatches.Circle((1,1), 0.25, linewidth=1))

coll = mcollections.PatchCollection(patches)
ax.add_collection(coll)
ax.autoscale_view()

plt.show()


Now, in this example the line width is always given with respect to the
screen space, i.e. does not change when I zoom into the plot. Is it
possible to specify a linewidth with respect to data space? I.e. to say
that a line (in both the Line2D and the Circle) should be let's say 0.1
in data space, and thus scale accordingly if I zoom in?

-Michael

--
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis  visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Impossible to draw a direction of arrows in Matplotlib???

2013-04-12 Thread Ryan Nelson
I'm not sure that I understand exactly what you are trying to do, but 
you may want to look into Matplotlib annotation. Here's a really quick 
example:


import matplotlib.pyplot as plt
plt.annotate('', (1, 1), (0, 0),
arrowprops=dict(facecolor='black'))
plt.axis([-1, 2, -1, 2])
plt.show()

There are many options to make very fancy arrows, and there are several 
places in the docs to read about this in more detail:

http://matplotlib.org/users/annotations_intro.html
http://matplotlib.org/users/annotations_guide.html

Hope that helps a little. Good luck.

Ryan

On 4/12/2013 5:55 AM, Bakhtiyor Zokhidov wrote:

Hi,
I have encountered some problem while I was drawing a direction of
arrow. I have point (x,y) coordinates and angle of them. What I want to
do is that to draw arrow according to the given angle (just to show the
point direction as an arrow in each point coordinate). Here, we should
assume coordinates of '+x', '+y', '-x ', '-y' are 90, 0, 270, 180
degrees, respectively.
I am a bit unfamiliar with Python drawing tools. I am still not sure to
draw directional point (arrow based on angle) whether I use pylab or
some other modules or.. still not sure at all. I put the following codes
as a sample to give better description:

import numpy as np
import scipy as sp
import pylab as pl


def draw_line(x,y,angle):
 # Inputs:
 x = np.array([ 2, 4, 8, 10, 12, 14, 16])
y = np.array([ 5, 10, 15, 20, 25, 30, 35])
angles = np.array([45,275,190,100,280,18,45])

# First, draw (x,y) coordinate
???
# Second, according to the angle indicate the direction as
an arrow
???

Thanks in advance for your friendly support,


--
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis  visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter


___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis  visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Impossible to draw a direction of arrows in Matplotlib???

2013-04-12 Thread andrew nelson

 
 Message: 1
 Date: Fri, 12 Apr 2013 13:55:32 +0400
 From: Bakhtiyor Zokhidov bakhtiyor_zokhi...@mail.ru
 Subject: [Matplotlib-users] Impossible to draw a direction of arrows
   in Matplotlib???
 
 Hi,
 I have encountered some problem while I was drawing a direction of
 arrow. I have point (x,y) coordinates and angle of them. What I want to
 do is that to draw arrow according to the given angle (just to show the
 point direction as an arrow in each point coordinate). Here, we should
 assume coordinates of '+x', '+y', '-x ', '-y' are 90, 0, 270, 180
 degrees, respectively.?
 I am a bit unfamiliar with Python drawing tools. I am still not sure to
 draw directional point (arrow based on angle) whether I use pylab or
 some other modules or.. still not sure at all. I put the following codes
 as a sample to give better description:




I see the potential for some confusion over the direction of arrows on a plot 
here.  In standard trigonometry angles of 0, 90, 180, 270 degrees lie along 
'+x' (1, 0), '+y' (0, 1), '-x' (-1, 0) and '-y' (0, -1).  Totally different to 
what you want.  However, this is obviously different to the compass rose.





Dr Andrew Nelson
andyf...@gmail.com
_


--
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis  visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] basemap scatter

2013-04-12 Thread ChaoYue
I'm afraid the scatter plot does not allow afterward adjustment with size
currently (by using setp).
Probably you should redraw the scatter points with different sizes. like

for x,y,z in zip(xlist,ylist,sizelist):
 m.scatter(x,y,s=z)

if you question is to change the real 2km or 1.5km to the size on the map,
sorry I don't know as I never did this. Probably you need  consider
projection.

Chao


On Fri, Apr 12, 2013 at 4:33 PM, marz_cyclone [via matplotlib] 
ml-node+s1069221n40883...@n5.nabble.com wrote:

 Hi all,

 I'm trying to do a scatter plot within a map created by basemap.

 m = Basemap(projection='ortho',lat_0=45,lon_0=0,resolution='l')
 X,Y = m(lon,lat)
 m.scatter(X,Y,s=sizes,c=data,edgecolor='none')

 This works fine. Now I want to change the sizes of the markers so that the
 marker at point A has a size that corresponds to circle with radius of 2.5
 km, point B to 1.5 km,  and so on.

 Has anyone ever done this?

 Thanks in advance.

 Mario Mech


 --

 Precog is a next-generation analytics platform capable of advanced
 analytics on semi-structured data. The platform includes APIs for building
 apps and a phenomenal toolset for data science. Developers can use
 our toolset for easy data analysis  visualization. Get a free account!
 http://www2.precog.com/precogplatform/slashdotnewsletter
 ___
 Matplotlib-users mailing list
 [hidden email] http://user/SendEmail.jtp?type=nodenode=40883i=0
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


 --
  If you reply to this email, your message will be added to the discussion
 below:
 http://matplotlib.1069221.n5.nabble.com/basemap-scatter-tp40883.html
  To start a new topic under matplotlib - users, email
 ml-node+s1069221n...@n5.nabble.com
 To unsubscribe from matplotlib, click 
 herehttp://matplotlib.1069221.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=2code=Y2hhb3l1ZWpveUBnbWFpbC5jb218MnwxMzg1NzAzMzQx
 .
 NAMLhttp://matplotlib.1069221.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewerid=instant_html%21nabble%3Aemail.namlbase=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespacebreadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml




-- 
***
Chao YUE
Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
UMR 1572 CEA-CNRS-UVSQ
Batiment 712 - Pe 119
91191 GIF Sur YVETTE Cedex
Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16





--
View this message in context: 
http://matplotlib.1069221.n5.nabble.com/basemap-scatter-tp40883p40884.html
Sent from the matplotlib - users mailing list archive at Nabble.com.--
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis  visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users