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

Showing 9 results of 9

From: Friedrich R. <fri...@gm...> - 2010年04月03日 21:14:09
Oh, sorry, it was late at night, and so on, but in fact you said it's
a standard example, so well ... I was wrong.
Friedrich
2010年4月1日 Friedrich Romstedt <fri...@gm...>:
> You forgot about the attachment?
>
> Friedrich
>
From: Friedrich R. <fri...@gm...> - 2010年04月03日 20:49:40
I think it should be possible to do unsorted scatter plot, so you can
avoid the second loop. Maybe the current source doesn't allow for,
but it's certainly possible (hu, I'm not that aquainted with current
z-sorting code, so maybe I'm wrong?) It may be that current z-sorting
uses the mesh grid.
One point caught my attention: Maybe use sets, or check in loop 1 if
you do not duplicate x or y data?
Do you mask the mesh points not used?
Friedrich
P.S.: And make shure to select "Answer to all" :-)
2010年4月2日 ericyosho <eri...@gm...>:
> Thanks, Friendrich,
>
> So the only problem narrows down to whether I've got to loop through
> the dict to form all the arrays, or there might be some way to define
> a "formatter", so that when I apply this formatter on to the
> dictionary, it splits the data into arrays properly.
>
> Zhe Yao
>
From: Diakronik <fre...@gm...> - 2010年04月03日 20:33:35
konstellationen wrote:
> 
> Hi, 
> 
> I am making plots for a publication using matplotlib which requires the
> use of heavy fonts. I am rendering text in the graph with Latex, which has
> a limited capability to make fonts more heavy. I partially solved the
> problem using the \boldmath Latex command for the axis-labels and text
> inside the plot (see attached figure). The only remaining text to be
> "bolden" are the tick labels. I can change their size via the
> xtick.labelsize rc parameter, but do not know how to make them heavier. 
> 
> Does anybody know what can be done to solve this?
> 
> Any help would be appreciated!!!! 
> 
> Best, Daniel 
> 
> 
I ran into the same problem today trying to prepare figures for my thesis,
and I figured out a way to do it...it's not pretty, but it works:
import matplotlib.pyplt as plt
tick_locs = range(start, stop, increment)
plt.xticks(tick_locs, [r"$\mathbf{%s}$" % x for x in tick_locs])
Hope this helps!
-- 
View this message in context: http://old.nabble.com/Bold-Latex-Tick-Labels-tp28037900p28129365.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: ms <dev...@gm...> - 2010年04月03日 18:04:27
Hi,
I am trying to use griddata to plot some (irregularly) spaced data as a
contour plot, but sometimes ALL the grid it outputs is masked: so no plot.
In the docs I read:
"A masked array is returned if any grid points are outside convex hull
defined by input data (no extrapolation is done)."
but I have no real idea of what does it mean.
Any suggestion to troubleshoot / understand what's going on?
Thanks!
m.
From: David F. <dav...@ya...> - 2010年04月03日 17:19:19
Hello -
I am using matplotlib in eclipse. For 3D plot test, I am using:
====================
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
import matplotlib.pyplot as plt
import numpy as np
fig = plt.figure()
ax = Axes3D(fig)
X = np.arange(-5, 5, 0.25)
Y = np.arange(-5, 5, 0.25)
X, Y = np.meshgrid(X, Y)
R = np.sqrt(X**2 + Y**2)
Z = np.sin(R)
ax.plot_surface(X, Y, Z, rstride=1, cstride=1, cmap=cm.jet)
plt.show()
====================
This script works fine outside of Eclipse; that is, just by running
"python testplot1.py"
but Eclipse says "undefined import from variable: jet"
The following are my script's header lines:
====================
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
import numpy as np
import matplotlib.pyplot as plt
====================
Suggestions are appreciated.
Regards, David
 
From: Enzo M. <enz...@gm...> - 2010年04月03日 14:40:18
Dear all,
Consider the following short program:
from matplotlib.pyplot import title, show
for i in xrange(3):
 title(i+1)
 print "window No. "+str(i+1)+" was closed"
 show()
If I run it under Windows XP, at each show() the program displays a window and
blocks; if I close the window by clicking on the "X" at the top right corner,
the program prints the message "window No. ... was closed" , then opens a new
window, and so on for a total of three iterations.
If I run it under Linux (Ubuntu 9.10, living inside a Virtualbox machine),
everything works the same until I close the first window, after which no new
windows are ever opened and displayed. The program does not die, because all
three messages are sent to console:
window No. 1 was closed
window No. 2 was closed
window No. 3 was closed
My questions for the cognoscenti are:
1. Why this difference?
2. How can I get under Linux the same behaviour as under Windows?
Thanks in advance,
Enzo
From: Marius 't H. <M.t...@ai...> - 2010年04月03日 11:43:14
Try this:
from pylab import *
from numpy import *
Z = random.randn(100,100)
figure()
subplot(1,2,1)
imgHandle = imshow(Z, cmap=cm.gray)
scatter(random.rand(10)*100,random.rand(10)*100)
colorbar(imgHandle)
title('Hello')
show()
By the way, I find jet a bad colormap to represent scientific data: it 
suggests bands in the data that aren't there and when reduced to 
luminance (eg. students printing/copying in black/white or in the eyes 
of all your colorblind colleagues) the two halves of the scale are 
identical, rendering all graphs completely ambiguous. ;)
Claus wrote:
> Hi,
> I've got two questions: 
> 1) one is related to colorbar() on multiple subfigures (see code example below): how do I add a scatterplot if I wanted multiple subfigures? Or, what am I doing wrong in the second code example
> 2) in either of the examples, how can I increase the distance between the top of the plot (imshow) and the bottom of the title?
>
>
> # code example 1: this works
> fig = plt.figure()
> plt.title('Hello')
> plt.imshow(interpolValsRas, cmap=cm.jet, interpolation='nearest', origin = 'lower', extent=[5,95,5,95]) # , 
> plt.scatter(measurementLoc[:,0], measurementLoc[:,1], 10, messwerte, cmap=cm.jet)
> plt.colorbar();
>
>
> # code example 2: this works generally, but only if the second last line is commented out
> # Q: how do I add a scatterplot if I wanted multiple subfigures?
> fig = plt.figure()
> ax = fig.add_subplot(111)
> plt.title('Hello')
> ax.imshow(interpolValsRas, cmap=cm.jet, interpolation='nearest', origin = 'lower', extent=[5,95,5,95]) # , 
> ax.scatter(measurementLoc[:,0], measurementLoc[:,1], 10, messwerte, cmap=cm.jet)
> # plt.colorbar();
> plt.show()
>
> Thanks for your help,
> Claus
> ------------------------------------------------------------------------------
> Download Intel&#174; Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
From: Claus <cla...@gm...> - 2010年04月03日 10:56:06
Hi,
I've got two questions: 
1) one is related to colorbar() on multiple subfigures (see code example below): how do I add a scatterplot if I wanted multiple subfigures? Or, what am I doing wrong in the second code example
2) in either of the examples, how can I increase the distance between the top of the plot (imshow) and the bottom of the title?
# code example 1: this works
fig = plt.figure()
plt.title('Hello')
plt.imshow(interpolValsRas, cmap=cm.jet, interpolation='nearest', origin = 'lower', extent=[5,95,5,95]) # , 
plt.scatter(measurementLoc[:,0], measurementLoc[:,1], 10, messwerte, cmap=cm.jet)
plt.colorbar();
# code example 2: this works generally, but only if the second last line is commented out
# Q: how do I add a scatterplot if I wanted multiple subfigures?
fig = plt.figure()
ax = fig.add_subplot(111)
plt.title('Hello')
ax.imshow(interpolValsRas, cmap=cm.jet, interpolation='nearest', origin = 'lower', extent=[5,95,5,95]) # , 
ax.scatter(measurementLoc[:,0], measurementLoc[:,1], 10, messwerte, cmap=cm.jet)
# plt.colorbar();
plt.show()
Thanks for your help,
Claus
From: Gary R. <gr...@bi...> - 2010年04月03日 00:25:53
Attachments: cplot_like.py
Hi Guy,
I am also interested in the answer to this. The cplot function in the 
mpmath module does exactly this using matplotlib, but very 
inefficiently, as it computes the colour of each pixel in the image in 
hls colour-space and generates the corresponding rgb value directly. I 
suspect this is how it has to be done, as colormaps in matplotlib are 1D 
sequences and the black-white (lightness) value is really another 
dimension. However mpmath's method can be improved by doing the mapping 
using array operations instead of computing it for each pixel.
I've attached a function I wrote to reproduce the Sage cplot command in 
my own work. It's a bit old and can be improved. It takes the Arg and 
Abs of a complex array as the first two arguments - you can easily 
change this to compute these inside the function if you prefer. The line
np.vectorize(hls_to_rgb) can be replaced - recent versions of matplotlib 
have a vectorized function called hsv_to_rgb() inside colors.py - so you 
replace the return line with the commented-out version if you first 
import hsv_to_rgb from colors.
I hope this helps.
I'm also curious: the plots you point to also show plots of the function 
"extrema", which are the phase singularities - does mathematica have a 
function that gives you these, or did you write your own function to 
find them?
regards,
Gary
Guy Rutenberg wrote:
> Hi,
> 
> Is there a way to generate colormaps for complex-valued functions using 
> matplotlib? The type of plots I'm looking for are like the plots in:
> http://commons.wikimedia.org/wiki/User:Jan_Homann/Mathematics
> 
> Thanks in advance,
> 
> Guy

Showing 9 results of 9

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 によって変換されたページ (->オリジナル) /