You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(3) |
Jun
|
Jul
|
Aug
(12) |
Sep
(12) |
Oct
(56) |
Nov
(65) |
Dec
(37) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(59) |
Feb
(78) |
Mar
(153) |
Apr
(205) |
May
(184) |
Jun
(123) |
Jul
(171) |
Aug
(156) |
Sep
(190) |
Oct
(120) |
Nov
(154) |
Dec
(223) |
| 2005 |
Jan
(184) |
Feb
(267) |
Mar
(214) |
Apr
(286) |
May
(320) |
Jun
(299) |
Jul
(348) |
Aug
(283) |
Sep
(355) |
Oct
(293) |
Nov
(232) |
Dec
(203) |
| 2006 |
Jan
(352) |
Feb
(358) |
Mar
(403) |
Apr
(313) |
May
(165) |
Jun
(281) |
Jul
(316) |
Aug
(228) |
Sep
(279) |
Oct
(243) |
Nov
(315) |
Dec
(345) |
| 2007 |
Jan
(260) |
Feb
(323) |
Mar
(340) |
Apr
(319) |
May
(290) |
Jun
(296) |
Jul
(221) |
Aug
(292) |
Sep
(242) |
Oct
(248) |
Nov
(242) |
Dec
(332) |
| 2008 |
Jan
(312) |
Feb
(359) |
Mar
(454) |
Apr
(287) |
May
(340) |
Jun
(450) |
Jul
(403) |
Aug
(324) |
Sep
(349) |
Oct
(385) |
Nov
(363) |
Dec
(437) |
| 2009 |
Jan
(500) |
Feb
(301) |
Mar
(409) |
Apr
(486) |
May
(545) |
Jun
(391) |
Jul
(518) |
Aug
(497) |
Sep
(492) |
Oct
(429) |
Nov
(357) |
Dec
(310) |
| 2010 |
Jan
(371) |
Feb
(657) |
Mar
(519) |
Apr
(432) |
May
(312) |
Jun
(416) |
Jul
(477) |
Aug
(386) |
Sep
(419) |
Oct
(435) |
Nov
(320) |
Dec
(202) |
| 2011 |
Jan
(321) |
Feb
(413) |
Mar
(299) |
Apr
(215) |
May
(284) |
Jun
(203) |
Jul
(207) |
Aug
(314) |
Sep
(321) |
Oct
(259) |
Nov
(347) |
Dec
(209) |
| 2012 |
Jan
(322) |
Feb
(414) |
Mar
(377) |
Apr
(179) |
May
(173) |
Jun
(234) |
Jul
(295) |
Aug
(239) |
Sep
(276) |
Oct
(355) |
Nov
(144) |
Dec
(108) |
| 2013 |
Jan
(170) |
Feb
(89) |
Mar
(204) |
Apr
(133) |
May
(142) |
Jun
(89) |
Jul
(160) |
Aug
(180) |
Sep
(69) |
Oct
(136) |
Nov
(83) |
Dec
(32) |
| 2014 |
Jan
(71) |
Feb
(90) |
Mar
(161) |
Apr
(117) |
May
(78) |
Jun
(94) |
Jul
(60) |
Aug
(83) |
Sep
(102) |
Oct
(132) |
Nov
(154) |
Dec
(96) |
| 2015 |
Jan
(45) |
Feb
(138) |
Mar
(176) |
Apr
(132) |
May
(119) |
Jun
(124) |
Jul
(77) |
Aug
(31) |
Sep
(34) |
Oct
(22) |
Nov
(23) |
Dec
(9) |
| 2016 |
Jan
(26) |
Feb
(17) |
Mar
(10) |
Apr
(8) |
May
(4) |
Jun
(8) |
Jul
(6) |
Aug
(5) |
Sep
(9) |
Oct
(4) |
Nov
|
Dec
|
| 2017 |
Jan
(5) |
Feb
(7) |
Mar
(1) |
Apr
(5) |
May
|
Jun
(3) |
Jul
(6) |
Aug
(1) |
Sep
|
Oct
(2) |
Nov
(1) |
Dec
|
| 2018 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2025 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
|
|
|
1
(7) |
2
(8) |
|
3
(3) |
4
(5) |
5
(2) |
6
(3) |
7
(4) |
8
(11) |
9
(4) |
|
10
|
11
(8) |
12
(10) |
13
(16) |
14
(14) |
15
(13) |
16
(1) |
|
17
|
18
(8) |
19
(6) |
20
(13) |
21
(15) |
22
(5) |
23
(13) |
|
24
(2) |
25
(4) |
26
(1) |
27
(4) |
28
(8) |
29
(11) |
30
(5) |
|
31
(3) |
|
|
|
|
|
|
|
From: Fernando M. <fer...@gm...> - 2011-07-21 21:02:12
|
I am facing problems for plotting figures using polycollection. The code below should do: 1- set two triangles: one with vertices at [0,0 0,1 1,0] and the other at [1,0 0,1 1,1] 2- give two random values to them 3- add these polygons to polycollection and set their values 4- plot the triangles edges only with triplot and save the eps 4.5- plot again with triplot and save the eps (I will explain why I am doing this) 5- plot the image with the values (using add_collection) and save as eps 6- set two new random values to these triangles (this step is not needed to reproduce the error) 7- plot again the image (using add_collection) and save as eps Steps 1 to 6 seem to be ok. The problem is that on step 7, the triangles are displaced in x and y directions. The graph is shown correctly on screen, however this displacement appears on the output file. This displacement does not appears when I plot twice the mesh with triplot. Only when I plot using add_collection. Thanks. Fernando. my settings are: matplotlib version: 1.0.1 matplotlib obtained from: deb http://ppa.launchpad.net/valavanisalex/matplotlib/ubuntu natty main system: Linux kalman 2.6.38-10-generic #46-Ubuntu SMP Tue Jun 28 15:07:17 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux no customizations on matplotlibrc running python with --verbose-helpful option returns $HOME=/home/fernando CONFIGDIR=/home/fernando/.matplotlib matplotlib data path /usr/share/matplotlib/mpl-data loaded rc file /etc/matplotlibrc matplotlib version 1.0.1 verbose.level helpful interactive is False units is False platform is linux2 Using fontManager instance from /home/fernando/.matplotlib/fontList.cache backend TkAgg version 8.5 findfont: Matching :family=sans-serif:style=normal:variant=normal:weight=normal:stretch=normal:size=medium to DejaVu Sans (/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf) with score of 0.100000 #------------------------------- # CODE - CODE - CODE #------------------------------- # -*- coding: utf-8 -*- import os import matplotlib.pyplot as plt import matplotlib.cm as cm import matplotlib.tri as tri from matplotlib.collections import PolyCollection import numpy as np class triangles_mesh(): def __init__(self,coords,topology,colormap=cm.gray): values=np.random.rand(topology.shape[0]) self.triangles=self.build_triangles(coords,topology,values,colormap) def build_triangles(self,coords,topology,image_rho,map_colors=cm.jet): (n_elem,n_nodes_local)=topology.shape lista_tri=[] colors=[] values_rho=[] for j in range(0,n_elem): verts = [(coords[i,0], coords[i,1]) for i in topology[j,:]] lista_tri.append(verts) values_rho.append(image_rho[j]) norma = cm.colors.Normalize(vmin=0, vmax=3) poligonos = PolyCollection(lista_tri,lw=0.4,cmap=map_colors,norm=norma) poligonos.set_array(np.array(values_rho)) return poligonos class mesh_2D(): def __init__(self): self.topology=np.array([[0,1,2],[1,3,2]]) self.coords=np.array([[0,0],[1,0],[0,1],[1,1]]) self.roi=np.array([1,2]) self.elem=triangles_mesh(self.coords,self.topology) def plot_mesh(self,file_name=None,flag_show_image=1): fig=plt.figure() my_axis=fig.add_subplot(111,aspect='equal') my_axis.triplot(self.coords[:,0],self.coords[:,1], self.topology,color=[0, 0,0 ],lw=0.4) plt.yticks([]) plt.xticks([]) my_axis.axis('off') x_max,y_max=self.coords.max(0) x_min,y_min=self.coords.min(0) my_axis.axis([x_min, x_max, y_min, y_max]) plt.draw() if file_name!=None: plt.savefig(file_name,transparent=True,format="eps",bbox_inches="tight") if flag_show_image==1: plt.show() plt.close() def plot_values(self,file_name=None,flag_show_image=1): fig=plt.figure() my_axis=fig.add_subplot(111,aspect='equal') my_axis.add_collection(self.elem.triangles) #plt.yticks([]) #plt.xticks([]) #my_axis.axis('off') x_max,y_max=self.coords.max(0) x_min,y_min=self.coords.min(0) my_axis.axis([x_min, x_max, y_min, y_max]) fig.canvas.draw() if file_name!=None: plt.savefig(file_name,transparent=True,format="eps",bbox_inches="tight") if flag_show_image==1: plt.show() plt.close() malha_pd=mesh_2D() malha_pd.plot_mesh("mesh.eps",flag_show_image=0) malha_pd.plot_mesh("mesh1.eps",flag_show_image=0) malha_pd.plot_values("values.eps",flag_show_image=1) # set new values () new_values=np.random.rand(malha_pd.topology.shape[0]) malha_pd.elem.triangles.set_array(np.array(new_values)) #plot again: here the problem appears malha_pd.plot_values("values1.eps",flag_show_image=1) #-------------------------- # END CODE - END CODE #-------------------------- |
|
From: Paul I. <piv...@gm...> - 2011-07-21 19:53:40
|
Hi Robert, robert rottermann, on 2011-07-21 11:25, wrote: > who ever migth be interested: > I achieved my goal in drawing lines trough a set of points using the path modul. > > http://matplotlib.sourceforge.net/users/path_tutorial.html Unless there were other considerations for getting this plot, it really didn't have to be this complicated, read on. > On 20.07.2011 20:49, robert rottermann wrote: > > frame1 = plt.gca() > > lx = [] > > ly = [] > > for pt in ((267, 140), (380, 773), (267, 958)): > > lx.append(pt[0]) > > ly.append(pt[1]) > > x,y = np.array([lx, ly]) > > line = mlines.Line2D(x, y, lw=5., alpha=0.4) > > frame1.add_line(line) The above can be done with just two lines: x,y = zip(*((267, 140), (380, 773), (267, 958))) 1.plot(x,y) best, -- Paul Ivanov 314 address only used for lists, off-list direct email at: http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7 |
|
From: Benjamin R. <ben...@ou...> - 2011-07-21 15:32:17
|
On Thu, Jul 21, 2011 at 1:10 AM, gary ruben <gar...@gm...> wrote: > I'm trying to make a surface plot using the latest version of mplot3d > from the git trunk and I have a couple of questions. The attached > image is close to what I would like. The associated plot command I am > using is > > ax.plot_surface(X, Y, Z, rstride=1, cstride=1, alpha=0.8, shade=True, > cmap=plt.cm.summer, > color='k', > facecolors='k', > lightsource = LightSource(azdeg=0, altdeg=0), > ) > > 1. Is there support now to automatically annotate the axis so that a > multiplier is added, as occurs in 2D plots, or should I do this > manually by rescaling the data for the moment? > Yes, offset text is now automatic and should activate in similar manner as it does for regular 2D axis formatters. You were one order of magnitude off from automatically triggering it. Also, I should note that it might be better to use "ax = fig.gca(projection='3d')" instead of "ax = Axes3D(fig)" because the former will leave more of a margin, which would allow the offset text to be fully visible. If you want the full figure area, then you may need to fiddle with the ax.zaxis._axinfo['label']['space_factor'] to bring it and the axis label closer to the axis. The odd thing that I am encountering right now while investigating your problem is that I can't seem to force the use of the offset. It could just be that I am doing it wrong, but I will look closer. > 2. Currently, it doesn't appear possible to shade the surface patches > according to just a base facecolor and their orientation to a light > source. Do I have to define a new colormap with a constant/single > colour to achieve this? Looking over the plot_surface code, this appears to be the case, however, looking back over the LightSource code, I believe it might be possible to update plot_surface to operate on situations where no cmap is specified. I will take a look today at that possibility and see if I can get it out for the v1.1.0 release. > 3. I have set alpha=0.8 to allow the wireframe lines to show through a > little. When shade=False, the wireframe is visible but I lose > orientation-based shading. Is there a way to overlay the wireframe > properly when shade=True? > > In plot_surface, when shade=True, it appears that both the facecolors and the edgecolors are set to the same colors. The only reason why the lines show up when you set transparency is that that alpha value is applied only to the faces and not the edges. Specifically, the logic is as follows: if fcolors is specified, then set that color for both facecolor and edgecolor. Else, if a cmap is specified, then give the polygon collection the data, limits and norm it needs to determine color itself. Else, then use the value of "color" to specify only the facecolors. I think the first branch of this logic is a bit wonky. I am inclined to make a small change that would only set the edgecolors if 'edgecolors' was not provided as a kwarg. This would enable users to specify the edgecolor they want without worrying about something else over-riding it. The only problem seems to be that there would be no shading of these grid lines. Would that still be acceptable to you? Thanks for your valuable feedback! Ben Root |
|
From: Yoshi R. <yo...@ro...> - 2011-07-21 09:26:17
|
what are you using right now, something like that? >>> a = np.random.random(70) >>> x = np.empty([10,a.shape[0]]) >>> x[:,:] = a >>> pl.contourf(x) you might want to suppress ticks on the y-axis. best regards, yoshi |
|
From: robert r. <ro...@re...> - 2011-07-21 09:26:07
|
who ever migth be interested: I achieved my goal in drawing lines trough a set of points using the path modul. http://matplotlib.sourceforge.net/users/path_tutorial.html robert On 20.07.2011 20:49, robert rottermann wrote: > hi there, > > I would like to draw a a set of lines on top of an image. > Somehow I do not get the result I want > > these are the points ((267, 140), (380, 773), (267, 958)) > > one of my divers atempts is: > > pic = plt.imread('../hlwd/effizienz_balken_01.jpg') > pic = np.fliplr(np.rot90(pic, k=2)) > plt.imshow(pic) > > frame1 = plt.gca() > > lx = [] > ly = [] > for pt in ((267, 140), (380, 773), (267, 958)): > lx.append(pt[0]) > ly.append(pt[1]) > x,y = np.array([lx, ly]) > line = mlines.Line2D(x, y, lw=5., alpha=0.4) > > frame1.add_line(line) > > plt.show() > > which produces on line instad of two. > > thanks for any pointers > robert > > > ------------------------------------------------------------------------------ > 10 Tips for Better Web Security > Learn 10 ways to better secure your business today. Topics covered include: > Web security, SSL, hacker attacks& Denial of Service (DoS), private keys, > security Microsoft Exchange, secure Instant Messaging, and much more. > http://www.accelacomm.com/jaw/sfnl/114/51426210/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
|
From: gary r. <gr...@bi...> - 2011-07-21 06:12:44
|
I'm trying to make a surface plot using the latest version of mplot3d from the git trunk and I have a couple of questions. The attached image is close to what I would like. The associated plot command I am using is ax.plot_surface(X, Y, Z, rstride=1, cstride=1, alpha=0.8, shade=True, cmap=plt.cm.summer, color='k', facecolors='k', lightsource = LightSource(azdeg=0, altdeg=0), ) 1. Is there support now to automatically annotate the axis so that a multiplier is added, as occurs in 2D plots, or should I do this manually by rescaling the data for the moment? 2. Currently, it doesn't appear possible to shade the surface patches according to just a base facecolor and their orientation to a light source. Do I have to define a new colormap with a constant/single colour to achieve this? Currently, it seems necessary to specify a colormap and that this is used instead of the patch facecolors option, but facecolors must still be specified to trigger the orientation-based shading. It seems a bit bizarre to have to define a cmap and facecolors when facecolors is actually ignored by the rendering. 3. I have set alpha=0.8 to allow the wireframe lines to show through a little. When shade=False, the wireframe is visible but I lose orientation-based shading. Is there a way to overlay the wireframe properly when shade=True? thanks, Gary |
|
From: gary r. <gar...@gm...> - 2011-07-21 06:11:20
|
I'm trying to make a surface plot using the latest version of mplot3d
from the git trunk and I have a couple of questions. The attached
image is close to what I would like. The associated plot command I am
using is
ax.plot_surface(X, Y, Z, rstride=1, cstride=1, alpha=0.8, shade=True,
cmap=plt.cm.summer,
color='k',
facecolors='k',
lightsource = LightSource(azdeg=0, altdeg=0),
)
1. Is there support now to automatically annotate the axis so that a
multiplier is added, as occurs in 2D plots, or should I do this
manually by rescaling the data for the moment?
2. Currently, it doesn't appear possible to shade the surface patches
according to just a base facecolor and their orientation to a light
source. Do I have to define a new colormap with a constant/single
colour to achieve this? Currently, it seems necessary to specify a
colormap and that this is used instead of the patch facecolors option,
but facecolors must still be specified to trigger the
orientation-based shading. It seems a bit bizarre to have to define a
cmap and facecolors when facecolors is actually ignored by the
rendering.
3. I have set alpha=0.8 to allow the wireframe lines to show through a
little. When shade=False, the wireframe is visible but I lose
orientation-based shading. Is there a way to overlay the wireframe
properly when shade=True?
thanks,
Gary
|
|
From: C M <cmp...@gm...> - 2011-07-21 03:34:04
|
> Try MultipleLocator: > > from matplotlib.ticker import MultipleLocator > halflocator = MultipleLocator(base=0.5) > ax.xaxis.set_major_locator(halflocator) > > etc. Thanks, that works for me. I didn't think I could use non-integers (0.5) because the docs said, "Set a tick on every integer that is multiple of base in the view interval". Earlier in that page, though, it does say base can be an integer or float. Che |
|
From: Charles R H. <cha...@gm...> - 2011-07-21 03:15:32
|
Hi Robert,
On Fri, Jul 15, 2011 at 9:49 AM, robert <ro...@re...> wrote:
> Hi there,
> I am all new to mathlib world..
>
> What I try to do is plotting some charts over an image.
> I would be very grateful, if somebody could provide me with an example.
> thanks
> robert
>
>
I just did this myself with this code:
def make_cutouts(h5file, band=1, vmin=None, vmax=None, dir='.'):
"""Browse pixel data by pixel selection
A shift-left-click on a pixel in ``image`` creates a plot of
the response data for that pixel. A shift--click on the
resulting plot will save it to two files in ``dir`` whose names
are of the form cutout-xcen-ycen.{dat,png}, where xcen and ycen
are replaced with the location of image center. The png file is
an rgb img, the dat file is raw uint16 data.
Parameters
----------
h5file : string
Path to h5 file containing image data.
band : int
Band to use. Must be 0 or 1.
vmax, vmin : float, optional
Maximum and minimum values to which the image will be scaled.
dir : string, optional
Path to directory in which plots will be saved.
"""
import matplotlib.pyplot as plt
import h5py
from widgets import Button
# get image data here so that it gets compiled into onclick
fin = h5py.File(h5file, 'r')
img = fin['band%d' % band][...]
src = fin['/'].attrs['input_filename']
fin.close()
m, n = img.shape
# make points for drawing square cutout
xcor = np.array([-128, 128, 128, -128, -128], dtype=float)/10
ycor = np.array([-128, -128, 128, 128, -128], dtype=float)/10
def save(fig, mouse, data):
def onclick(event):
if event.button == 1:
xcen = mouse.xdata
ycen = mouse.ydata
i = int(xcen + .5)*10
j = int(ycen + .5)*10
# write data to file
path = os.path.join(dir, 'cutout-%05d-%05d' % (i,j))
fout = h5py.File(path + '.h5', 'w')
fout.create_dataset('image', data.shape, data.dtype)
fout['/'].attrs['input_filename'] = src
fout['/'].attrs['x_center_pixel'] = i
fout['/'].attrs['y_center_pixel'] = j
fout['image'][...] = data
fout.close()
fig.savefig(path + ".png")
# draw square around cutout
mouse.inaxes.plot(xcen + xcor, ycen + ycor, 'r', lw=2)
mouse.canvas.draw()
return onclick
def onclick(event):
mouse = event.mouseevent
if mouse.button == 1 and mouse.key == "shift":
i = int(mouse.xdata + .5)*10
j = int(mouse.ydata + .5)*10
src_axs = mouse.inaxes
ul_x = max(0, i - 128)
ul_y = max(0, j - 128)
lr_x = min(n, i + 128)
lr_y = min(m, j + 128)
data = img[ul_y:lr_y, ul_x:lr_x]
#
newfig = plt.figure()
newfig.subplots_adjust(top=.90)
# add save button
butax = newfig.add_axes([0.45, .92, .1, 0.04])
button = Button(butax, 'Save', color='red', hovercolor='gold')
button.on_clicked(save(fig, mouse, data))
# display image of cutout
axs = newfig.add_subplot(111)
tmp = axs.imshow(data)
newfig.colorbar(tmp)
newfig.show()
fig = plt.figure()
axs = fig.add_subplot(111)
tmp = axs.imshow(img[::10, ::10], vmin=vmin, vmax=vmax, origin='lower',
picker=True)
xmin, xmax, ymin, ymax = np.array(tmp.get_extent()) + .5
axs.set_xticks([t for t in axs.get_xticks() if t >= 0 and t <= xmax])
axs.set_yticks([t for t in axs.get_yticks() if t >= 0 and t <= ymax])
fig.canvas.mpl_connect("pick_event", onclick)
fig.show()
Which is probably more complex than what you need. What it does is display a
thumbnail of a very large image on which you can shift-click to blowup a
256x256 portion in a separate figure. If you then click the (custom) save
button on the blowup it saves the data together with a thumbnail and plots a
square around the cutout pixels in the original image. The tricky part is
that the image axis generally starts at -.5 and this will cause problems as
the plot will want to put up it's own ticks that excede the image bounds and
you will get big white borders where you don't want them. Hence I call
axs.set_xticks etc. to remove the offending ticks. To bad the image itself
doesn't make its own ticks available.
I had to rewrite the button code to make this work as the first click
handler takes the button with it when it exits as the figure doesn't keep a
reference to it, but that is another problem ;)
Chuck
|
|
From: C M <cmp...@gm...> - 2011-07-21 03:12:28
|
A runnable code sample is attached. I'm trying to plot durations in time (sec to hours) on the y axis such that if you zoom, it changes the units and axis label appropriately. When run, it looks right. But, when I zoom on the first point, it is shown on the y axis at '0.20' minutes. I would like it to say '12 seconds'. I would think the FuncFormatter I am trying to use should be able to do that, but I cannot figure it out. For now, those attempts are commented out in the code. How can I create a formatter such that zooming changes the tick and axis labels in this way? Any help is appreciated. Thanks, Che |
|
From: Gerald S. <gd...@mr...> - 2011-07-21 02:21:05
|
The version of PySide doesn't really matter so long as it is reasonably new. You need a newer version of Matplotlib and yes, the Github master is newer than the current release. Gerald. On 20/07/2011 8:29 PM, lionel chiron wrote: > Hi Gerald again, > > I recuperated the Pyside last version the 1.0.4 from Pyside's site but > I obtained the same error message trying to use my former code (same > used with PyQt with Figure Canvas) > raise ImportError, "Warning: formlayout requires PyQt4>v4.3" > Is the github version even more recent than this one?? > Thanks > > Regards > Lionel > > > 2011/7/20 Gerald Storer <gd...@mr... <mailto:gd...@mr...>> > > Have a closer look at the example I gave. > > The currently released version of matplotlib doesn't support > PySide at all. So I cheated and simply drew to the generic Agg > backend and then copied the whole figure (gcf = get current > figure) into a PySide QImage object at the end. The QImage can > then be displayed however you want inside your Qt application. I > used a QGraphicsScene but there are other options. > > If you really wanted to I guess you could use FigureCanvasAgg as > an intermediary - but the process is fundamentally different. You > can't just drop that it into your PySide app as a widget like you > can with FigureCanvasQTAgg. > > As mentioned earlier, if you'd like to use the same code simply > wait for the next release of matplotlib which will support PySide > or you can get a copy of the source from github master today that > also support PySide. > > Gerald. > > > On 20/07/2011 3:59 PM, lionel chiron wrote: >> Hi Gerald, >> >> I found yesterday interesting informations on a forum where you >> answered about Matplotlib and pyside .. but some details are >> missing to make what I want. >> Few days ago I developped stuff in PyQt I 'd like to recuperate >> in Pyside.. the central difficulty is to import Matplotlib in >> Pyside. >> In PyQt I was using FigureCanvasQTAgg but in Pyside I couldn't >> find something equivalent allowing to link Mpl and pyside.. >> It seems you're able to make drawings (with add.patch) but how to >> do for inserting a figure? >> >> Thanks >> >> Best >> >> Lionel > > > |
|
From: Eric F. <ef...@ha...> - 2011-07-21 01:37:21
|
On 07/20/2011 03:17 PM, C M wrote: > On Wed, Jul 20, 2011 at 7:56 PM, Gökhan Sever<gok...@gm...> wrote: >> >> >> On Wed, Jul 20, 2011 at 5:41 PM, C M<cmp...@gm...> wrote: >>> >>> On Wed, Jul 20, 2011 at 7:24 PM, Buchholz, Greg >>> <gbu...@in...> wrote: >>>>> -----Original Message----- >>>>> From: C M [mailto:cmp...@gm...] >>>>> >>>>> Sorry, this is super-simple, but I'm lost in the whole >>>>> locator/formatter part of the docs. >>>>> >>>>> How can I make a locator that just places a tick at every multiple of >>>>> 0.5 around the data? So the y axis would look like: >>>>> >>>>> 3.5 -- >>>>> 3.0 -- >>>>> 2.5 -- >>>>> 2.0 -- >>>>> 1.5 -- >>>>> 1.0 -- >>>> >>>> Do you want something like: >>>> >>>> ylim(1.0,3.5) >>>> yticks(arrange(1.0,4.0,0.5)) >>> >>> I'm not sure, because I can't try it out--I'm using the OO matplotlib, >>> not Pyplot. What's the equivalent of this in the OO API? >> >> >> ax.axis((xmin, xmax, ymin, ymax)) >> ax.yaxis.set_ticks(np.arange(1.0, 4.0, 0.5)) > > Thanks. > > But in order to use this, I have to know ymin and ymax, based on the > data. But I thought this was the point of the locators--that they > could assign the ticks based on the range of the data and then some > rule about placement of ticks in that range. But when I look at the > various kinds of locators in the docs, none have a parameter that is > equivalent to the 0.5 above in set_ticks. > > Or do they and I just missed it? Try MultipleLocator: from matplotlib.ticker import MultipleLocator halflocator = MultipleLocator(base=0.5) ax.xaxis.set_major_locator(halflocator) etc. > > ------------------------------------------------------------------------------ > 5 Ways to Improve& Secure Unified Communications > Unified Communications promises greater efficiencies for business. UC can > improve internal communications as well as offer faster, more efficient ways > to interact with customers and streamline customer service. Learn more! > http://www.accelacomm.com/jaw/sfnl/114/51426253/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
|
From: Gökhan S. <gok...@gm...> - 2011-07-21 01:20:05
|
On Wed, Jul 20, 2011 at 7:17 PM, C M <cmp...@gm...> wrote: > On Wed, Jul 20, 2011 at 7:56 PM, Gökhan Sever <gok...@gm...> > wrote: > > > > > > On Wed, Jul 20, 2011 at 5:41 PM, C M <cmp...@gm...> wrote: > >> > >> On Wed, Jul 20, 2011 at 7:24 PM, Buchholz, Greg > >> <gbu...@in...> wrote: > >> >>-----Original Message----- > >> >>From: C M [mailto:cmp...@gm...] > >> >> > >> >>Sorry, this is super-simple, but I'm lost in the whole > >> >>locator/formatter part of the docs. > >> >> > >> >>How can I make a locator that just places a tick at every multiple of > >> >>0.5 around the data? So the y axis would look like: > >> >> > >> >>3.5 -- > >> >>3.0 -- > >> >>2.5 -- > >> >>2.0 -- > >> >>1.5 -- > >> >>1.0 -- > >> > > >> > Do you want something like: > >> > > >> > ylim(1.0,3.5) > >> > yticks(arrange(1.0,4.0,0.5)) > >> > >> I'm not sure, because I can't try it out--I'm using the OO matplotlib, > >> not Pyplot. What's the equivalent of this in the OO API? > > > > > > ax.axis((xmin, xmax, ymin, ymax)) > > ax.yaxis.set_ticks(np.arange(1.0, 4.0, 0.5)) > > Thanks. > > But in order to use this, I have to know ymin and ymax, based on the > data. But I thought this was the point of the locators--that they > could assign the ticks based on the range of the data and then some > rule about placement of ticks in that range. But when I look at the > various kinds of locators in the docs, none have a parameter that is > equivalent to the 0.5 above in set_ticks. > > Or do they and I just missed it? > You can call min and max functions on your data arrays and make adjustments in your tick placement accordingly. -- Gökhan |
|
From: C M <cmp...@gm...> - 2011-07-21 01:17:29
|
On Wed, Jul 20, 2011 at 7:56 PM, Gökhan Sever <gok...@gm...> wrote: > > > On Wed, Jul 20, 2011 at 5:41 PM, C M <cmp...@gm...> wrote: >> >> On Wed, Jul 20, 2011 at 7:24 PM, Buchholz, Greg >> <gbu...@in...> wrote: >> >>-----Original Message----- >> >>From: C M [mailto:cmp...@gm...] >> >> >> >>Sorry, this is super-simple, but I'm lost in the whole >> >>locator/formatter part of the docs. >> >> >> >>How can I make a locator that just places a tick at every multiple of >> >>0.5 around the data? So the y axis would look like: >> >> >> >>3.5 -- >> >>3.0 -- >> >>2.5 -- >> >>2.0 -- >> >>1.5 -- >> >>1.0 -- >> > >> > Do you want something like: >> > >> > ylim(1.0,3.5) >> > yticks(arrange(1.0,4.0,0.5)) >> >> I'm not sure, because I can't try it out--I'm using the OO matplotlib, >> not Pyplot. What's the equivalent of this in the OO API? > > > ax.axis((xmin, xmax, ymin, ymax)) > ax.yaxis.set_ticks(np.arange(1.0, 4.0, 0.5)) Thanks. But in order to use this, I have to know ymin and ymax, based on the data. But I thought this was the point of the locators--that they could assign the ticks based on the range of the data and then some rule about placement of ticks in that range. But when I look at the various kinds of locators in the docs, none have a parameter that is equivalent to the 0.5 above in set_ticks. Or do they and I just missed it? |