SourceForge logo
SourceForge logo
Menu

matplotlib-users — Discussion related to using matplotlib

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
(4)
2
(20)
3
(8)
4
(10)
5
(4)
6
(8)
7
(4)
8
(9)
9
(11)
10
(12)
11
(13)
12
(3)
13
(17)
14
(4)
15
16
(10)
17
(9)
18
(11)
19
(4)
20
(17)
21
(6)
22
(9)
23
(35)
24
(17)
25
(9)
26
(16)
27
(17)
28
(14)

Showing 4 results of 4

Hi Chris,
thanks for your reply, helpful as usual :)
On Fri, Jan 30, 2009 at 18:59, Chris Walker
<ch...@ch...> wrote:
> Firstly, good luck with the book.
cheers :)
> The sort of book I'd buy would explain how to use the combination of
> matplotlib/ipython/scipy/numpy to analyse data.
Sadly, that would not the book I'll write :( The editor wanted to
target another audience for the book: experienced python developers,
with no knowledge of matplotlib; so an introductionary book, that will
show even how to integrate mpl on GTK/WX application and on the web.
I pushed to have something about science, and a chapter will be about
that, but I need your (all) inputs, because my science days are long
back in the past ;)
>> - what are the (basic) things that, when you were beginning to use
>> matplotlib, you wanted to see grouped up but couldn't find?
>> - what would you like to see in a book about matplotlib?
>
> Start off by reading data from a file, plotting it and fitting a
> function to that data.
That sounds something that could land in the "science" chapter.
> Plotting with related scales
> ----------------------------
>
> Sometimes it is useful to plot related scales on x1 and x2 axes. I've
> come across this several times in different contexts. In its simplest
> form, there is a linear relationship between the axes. In a mechanical test, you might want extension on the x1 axis and strain on the x2 axis (for example).
>
> Sometimes there is not a linear relationship. For example you might
> want to plot frequency (or photon energy) on x1 and wavelength on x2.
>
> An even more complex example is a Hall-Petch plot:
>
> (Yield Stress) = k/sqrt(Grain Size)
>
> So plotting 1/Sqrt(Grain Size) on the X1 axis gives a linear
> plot, but it would be useful to plot the grain size on the X2 scale.
Err, I think I lost you ;)
What you want is 2 plots on the same figure? so not 2 Ys for the same
X (let's say X is time, and Y1 is stock price variation, and Y2 is the
percentage change), you want X1-Y1 (let's say on the bottom-left) and
X2-Y2 (on the upper-right): did I get you?
> ipython and emacs
> -----------------
>
> Suppose I want to write a script to analyse some data (perhaps I want
> a record of what I've done, or perhaps I'd like to perform the same
> analysis on several data sets). I'd probably do so in emacs - but it
> is useful to do some experimentation in ipython - tab completion is
> particularly useful. I feel there must be a good way to do my
> experimentation in ipython and save the important bits in emacs - but
> I've not sat down and worked out an efficient way of doing this.
I think the preferred way to do so it using ipython, and for now I
plan only to show it on the book.
> Data aqcuisition and experimental control:
> -----------------------------------------
>
> Writing a simple application to acquire data - ideally from multiple
> sources and plot the data as it is acquired. In my case I wanted to
> combine mechanical with electrical tests. A couple of interesting
> articles by G Varoquaux are listed at
> http://wiki.debian.org/DebianScience/DataAcquisition
>
> This is perhaps beyond the scope of the book, but it has come up on
> the mailing lists a couple of times. The ideal application would have
> a gui for simple use, but a command line (probably ipython) for more
> more complex use - perhaps performing a series of tests under
> different conditions.
I thought about an example for this already! :) I thought to develop a
sample application for GTK/WX that display some system value (like cpu
usage or so, in this way everyone can run the example) plotting the
information as it comes (for 30 secs, for example).
> Some discussion of plotting non gridded 2d data should also be in
> there.
for example?
>> Your suggestions are really appreciated :) And wish me good luck!
>
> I don't think it is the thrust of your book, but another book I was
> looking for is "A cookbook of Numerical simulations of classic
> physics/engineering problems". For use by physicists/engineers who
> don't want to rewrite things from scratch.
As said, even if my degree is in linear algebra, my science days are
gone, so it won't be in the book, if not for that chapter about
science and mpl.
> Good luck.
Cheers,
-- 
Sandro Tosi (aka morph, morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi
From: Eli B. <bre...@he...> - 2009年02月01日 17:41:44
Hi,
I'm looking into customizing the the tick positions on an imshow plot. I 
found that you can do this by doing
img = imshow(data)
img.ax.xaxis.set_ticks([100.,200.])
The problem with this method is that it moves the tick positions on the 
bottom and top x axis. What if I wanted to do have the top axes show 
ticks at slightly different positions than the bottom one? Any ideas or 
suggestions would be greatly appreciated
-Eli
From: Jouni K. S. <jk...@ik...> - 2009年02月01日 14:58:35
KarlBlau <mai...@we...> writes:
> I would like to change the hue range of the hsv color map to use only hue
> values between 0 and 0.6667. I checked the documentation of matplotlib and
> searched in the internet but couldn't find the answer.
There doesn't seem to be any predefined functionality for this. The
easiest way to achieve this is probably just to take the definition of
hsv from _cm.py and modify it a little:
data = {'red': ((0., 1., 1.),(0.158730, 1.000000, 1.000000),
 (0.174603, 0.968750, 0.968750),(0.333333, 0.031250, 0.031250),
 (0.349206, 0.000000, 0.000000),(0.666667, 0.000000, 0.000000)),
 'green': ((0., 0., 0.),(0.158730, 0.937500, 0.937500),
 (0.174603, 1.000000, 1.000000),(0.507937, 1.000000, 1.000000),
 (0.666667, 0.062500, 0.062500)),
 'blue': ((0., 0., 0.),(0.333333, 0.000000, 0.000000),
 (0.349206, 0.062500, 0.062500),(0.507937, 1.000000, 1.000000),
 (0.666667, 1.000000, 1.000000))}
for k,v in data.items():
 data[k] = [(a/0.666667, b, c) for (a,b,c) in v]
myhsv = matplotlib.colors.LinearSegmentedColormap('myhsv', data)
-- 
Jouni K. Seppänen
http://www.iki.fi/jks
From: mfabulous <mx...@gm...> - 2009年02月01日 10:27:47
Hello,
I apologize if this was asked earlier.
I have following problem: I am creating multi panaled plots with share
xaxis.
It became common in publications to plot such plots without vspacing, so
that
they tough each other ( I attached a pdf 
http://www.nabble.com/file/p21773509/bN3368MJ_zhlnHD72324.pdf
bN3368MJ_zhlnHD72324.pdf 
to clearify the situation.).
In such plots the bottom and uppermost yaxis labels will overlap. I tried a
dirty hack to
overcome this problem, but this does not always produce nice results. Is
there a general solution?
Regards,
Maximilian 
-- 
View this message in context: http://www.nabble.com/Yaxis-labels-in-plots-with-no-vspacing-tp21773509p21773509.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

Showing 4 results of 4

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /