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

Showing 15 results of 15

Yeah it makes sense. I still can't find the bug, which it most likely is. I will keep looking and see what i find.
Thanks for the help
-----Original Message-----
From: Eric Firing [mailto:ef...@ha...] 
Sent: Tuesday, June 30, 2015 1:11 PM
To: mat...@li...
Subject: Re: [Matplotlib-users] TypeError: Dimensions of C (645, 536) are incompatible with X (538) and/or Y (646); see help(pcolormesh)
On 2015年06月30日 6:41 AM, Benjamin Root wrote:
> It looks like your X data is one element larger than it needs to be. I 
> know pcolor() accepts grids that are (N+1,M+1), and I *think* 
> pcolormesh does the same. It will also accept grids that are (N,M) as 
> well, but will drop the last row and collumn.
Yes, pcolormesh and pcolor use the same argument parsing and checking. 
They actually *want* N+1, M+1; the *acceptance* of N, M is a matlab-ism that is convenient for quick looks, but is also a potential source of error.
The OP has an X dimension of M+2, which indicates an error earlier in the OP's code.
Eric
------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
Matplotlib-users mailing list
Mat...@li...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Sterling S. <sm...@fu...> - 2015年07月09日 16:50:46
Can you be more specific about the problem you are having?
-Sterling
On Jul 9, 2015, at 9:40AM, peter <com...@ya...> wrote:
> hi,
> 
> my code was working fine, but now i cant figure out what went wrong.
> any ideas?
> 
> the code is supposed to plot a timeseries which it does and overlay it with another that is partially defined
> the input file is contructed like this:
> the first line is just for information purposes.
> after that:
> the first row is a growing number (the x value), the second is the timeseries and the third is the partially defined second timeseries
> 
> this is the code, after the code is a example input file.
> the code is also accessible via this paste service: https://dpaste.de/5ZrX it got a nice python code formatter.
> 
> 	• def plotTimeSeriesAndSAX(inputfile_tmp, verbose=False):
> 	• 
> 	• if verbose:
> 	• print "plotTimeSeriesAndSAX()"
> 	• print "\tinputfile:", inputfile_tmp
> 	• print "\toutputfile: %s.png" % inputfile_tmp
> 	• 
> 	• inputfile = open(inputfile_tmp, "r");
> 	• 
> 	• 
> 	• # this holds my timeseries
> 	• x = []
> 	• y = []
> 	• 
> 	• # this holds my "pattern"
> 	• pattern_x_values = []
> 	• pattern_y_values = []
> 	• 
> 	• # these are for temporary use only, hold the current pattern data
> 	• tmp_x = []
> 	• tmp_y = []
> 	• 
> 	• 
> 	• # remove pattern/sax string, sax_string_with_Z from the datafile, only used as text in the plot
> 	• first_line = inputfile.readline()
> 	• pattern, sax, sax_string_with_Z = first_line.split()
> 	• 
> 	• 
> 	• 
> 	• 
> 	• for line in inputfile.readlines():
> 	• 
> 	• data = line.split()
> 	• x_data = data[0]
> 	• y_data = data[1]
> 	• 
> 	• #if there is a third line (pattern at this position)
> 	• if len(data) == 3:
> 	• y2_data = data[2]
> 	• tmp_y.append(y2_data)
> 	• tmp_x.append(x_data)
> 	• else:
> 	• # if the pattern ends, add it to pattern_x/y_value and clear the tmp list
> 	• if len(tmp_x) != 0:
> 	• pattern_x_values.append(tmp_x)
> 	• pattern_y_values.append(tmp_y)
> 	• tmp_x = []
> 	• tmp_y = []
> 	• 
> 	• 
> 	• x.append(x_data)
> 	• y.append(y_data)
> 	• 
> 	• #if pattern == "ccd":
> 	• # print "pattern x_values:", pattern_x_values
> 	• # print "pattern y_values:", pattern_y_values
> 	• if verbose:
> 	• print "\ttimeseries y value", y
> 	• print "pattern x_values:", pattern_x_values
> 	• print "pattern y_values:", pattern_y_values
> 	• 
> 	• 
> 	• 
> 	• colors = ["red", "magenta", "mediumblue", "darkorchid", "grey"]
> 	• #linestyle = ["-", "--"]
> 	• 
> 	• # without this, the second plot contains the first and the second
> 	• # the third plot contains: the first, second and third
> 	• plot.clf()
> 	• 
> 	• # plot all my patterns into the plot
> 	• for s in range(0,len(pattern_x_values)):
> 	• #if verbose:
> 	• # print "\tpattern x value:", pattern_x_values[s]
> 	• # print "\tpattern y value:", pattern_y_values[s]
> 	• 
> 	• plot.plot(pattern_x_values[s], pattern_y_values[s], colors[1])
> 	• 
> 	• 
> 	• #plot.plot(x_all[0], y_all[0]) 
> 	• 
> 	• 
> 	• import matplotlib.patches as mpatches
> 	• 
> 	• 
> 	• #red_patch = mpatches.Patch(color='red', label='The red data')
> 	• 
> 	• from time import gmtime, strftime
> 	• current_date = strftime("%Y-%m-%d %H:%M:%S", gmtime())
> 	• 
> 	• 
> 	• fig = plot.figure()
> 	• 
> 	• 
> 	• fig.text(0, 0, 'bottom-left corner')
> 	• fig.text(0, 1, current_date, ha='left', va='top')
> 	• mytext = "pattern: %s sax: %s sax with Z: %s" % (pattern, sax, sax_string_with_Z)
> 	• fig.text(1,1, mytext )
> 	• 
> 	• 
> 	• # add the original timeseries to the plot
> 	• plot.plot(x,y, "forestgreen")
> 	• #if pattern == "ccd":
> 	• # plot.show()
> 	• 
> 	• 
> 	• directory, filename = os.path.split(inputfile_tmp)
> 	• 
> 	• plot.savefig(os.path.join(directory, "plots/%s.png" % filename))#, bbox_inches='tight')
> 	• # remove the last figure from memory
> 	• #plot.close()
> 	• 
> 	• 
> 	• 
> 	• 
> 	• 
> 	• 
> 	• 
> 	• 
> 	• #input:
> 	• dee ccccccccccaacddeedcccccccdc ZZZZZZZZZZZZZZdeeZZZZZZZZZZ
> 	• 1 -0.015920084 
> 	• 2 -0.044660769 
> 	• 3 -0.044660769 
> 	• 4 -0.092561907 
> 	• 5 0.012820599 
> 	• 6 -0.015920084 
> 	• 7 0.012820599 
> 	• 8 -0.054240996 
> 	• 9 0.031981054 
> 	• 10 0.031981054 
> 	• 11 -0.025500313 
> 	• 12 -0.044660769 
> 	• 13 0.012820599 
> 	• 14 -0.025500313 
> 	• 15 0.0032403709 
> 	• 16 -0.006339857 
> 	• 17 0.0032403709 
> 	• 18 -0.025500313 
> 	• 19 0.031981054 
> 	• 20 0.031981054 
> 	• 21 0.031981054 
> 	• 22 0.022400826 
> 	• 23 0.031981054 
> 	• 24 0.05114151 
> 	• 25 0.079882193 
> 	• 26 0.05114151 
> 	• 27 0.05114151 
> 	• 28 0.05114151 
> 	• 29 0.099042646 
> 	• 30 0.060721738 
> 	• 31 -0.015920084 
> 	• 32 -0.054240996 
> 	• 33 0.23316584 
> 	• 34 0.26190652 
> 	• 35 0.37686926 
> 	• 36 0.12778333 
> 	• 37 -0.044660769 
> 	• 38 -0.26500601 
> 	• 39 -0.41828965 
> 	• 40 -0.38954897 
> 	• 41 -0.26500601 
> 	• 42 -0.14046305 
> 	• 43 -0.073401452 
> 	• 44 -0.12130259 
> 	• 45 -0.082981679 
> 	• 46 -0.14046305 
> 	• 47 -0.054240996 
> 	• 48 -0.082981679 
> 	• 49 -0.015920084 
> 	• 50 -0.073401452 
> 	• 51 -0.015920084 
> 	• 52 0.10862288 
> 	• 53 1.1816084 
> 	• 54 -1.3379915 
> 	• 55 -4.6335899 
> 	• 56 -6.74124 
> 	• 57 -4.7772933 
> 	• 58 -3.4839626 
> 	• 59 -2.075669 
> 	• 60 -1.0984858 
> 	• 61 -0.37038851 
> 	• 62 -0.063821223 
> 	• 63 0.11820311 
> 	• 64 0.13736356 
> 	• 65 0.15652401 
> 	• 66 0.11820311 
> 	• 67 0.32896812 
> 	• 68 0.27148675 
> 	• 69 0.30022744 
> 	• 70 0.31938789 
> 	• 71 0.3577088 0.5449999999999999 
> 	• 72 0.40560994 0.5449999999999999 
> 	• 73 0.44393085 0.5449999999999999 
> 	• 74 0.49183198 0.5449999999999999 
> 	• 75 0.67385632 0.5449999999999999 
> 	• 76 0.79839928 0.84 
> 	• 77 0.9995841 0.84 
> 	• 78 1.1528677 0.84 
> 	• 79 1.4115338 0.84 
> 	• 80 1.5552373 0.84 
> 	• 81 1.7468418 0.84 
> 	• 82 1.7755825 0.84 
> 	• 83 1.7276813 0.84 
> 	• 84 1.4115338 0.84 
> 	• 85 1.0858061 0.84 
> 	• 86 0.65469586 
> 	• 87 0.43435063 
> 	• 88 0.21400538 
> 	• 89 0.14694379 
> 	• 90 0.089462421 
> 	• 91 0.070301966 
> 	• 92 0.031981054 
> 	• 93 0.05114151 
> 	• 94 0.070301966 
> 	• 95 0.13736356 
> 	• 96 0.079882193 
> 	• 97 0.12778333 
> 	• 98 0.15652401 
> 	• 99 0.16610425 
> 	• 100 0.13736356 
> 	• 101 0.13736356 
> 	• 102 0.089462421 
> 	• 103 0.2523263 
> 	• 104 0.21400538 
> 	• 105 0.22358561 
> 	• 106 0.1852647 
> 	• 107 0.19484493 
> 	• 108 0.1852647 
> 	• 109 0.16610425 
> 	• 110 0.13736356 
> 	• 111 0.15652401 
> 	• 112 0.14694379 
> 	• 113 0.16610425 
> 	• 114 0.099042646 
> 	• 115 0.12778333 
> 	• 116 0.13736356 
> 	• 117 0.089462421 
> 	• 118 0.079882193 
> 	• 119 0.089462421 
> 	• 120 0.041561282 
> 	• 121 0.041561282 
> 	• 122 0.079882193 
> 	• 123 0.11820311 
> 	• 124 0.099042646 
> 	• 125 0.089462421 
> 	• 126 0.05114151 
> 	• 127 0.17568447 
> 	• 128 0.30022744 
> 	• 129 0.32896812 
> 	• 130 0.42477039 
> 	• 131 0.17568447 
> 	• 132 0.022400826 
> 	• 133 -0.20752464 
> 	• 134 -0.24584556 
> 	• 135 -0.24584556 
> 
> 
> 
> ------------------------------------------------------------------------------
> Don't Limit Your Business. Reach for the Cloud.
> GigeNET's Cloud Solutions provide you with the tools and support that
> you need to offload your IT needs and focus on growing your business.
> Configured For All Businesses. Start Your Cloud Today.
> https://www.gigenetcloud.com/_______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Brendan B. <bre...@br...> - 2015年07月09日 16:50:40
On 2015年07月09日 07:40, Jonno wrote:
> I was thinking of doing that or having 2 surface plots but I think it
> would be visually quite confusing.
> I was trying to think of an example since I'm sure someone has come up
> with a nice way to display this kind of data.
> Imagine if the data was average temperature (a) and average rainfall (b)
> for a region in the world (lat/long = x,y). The goal is to display the
> data such that it's obvious where the locations are that have closest to
> the ideal temp/rain combination.
> How would you go about that?
	It's not an easy thing to visualize in general. You might want to look 
at approaches to visualizing complex functions (i.e., functions whose 
input and output are both complex variables). These essentially map 
pairs (a, b) to pairs (x, y) as in your situation, and mathematicians 
have come up with various ways to visualize them. Some are described at 
https://www.pacifict.com/ComplexFunctions.html and the wikipedia article 
at https://en.wikipedia.org/wiki/Complex_analysis has some links in the 
references to web pages for graphing such functions.
	If the data are measured at (or can be reasonably reduced to) discrete 
points (as temp/rainfall are likely to be), another possibility is a 
scatterplot using, say, the color and size of the markers as indicators 
of the two variables (e.g., red/blue for hot/cold temp, larger/smaller 
circles for higher/lower rainfall).
	In some cases, like your example with temperature and rainfall, you may 
instead be able to combine the two output dimensions into a single one 
that somehow captures the overall "distance" from the ideal point. That 
is, for a given point, if your goal is to show how close it is to the 
ideal *combination* of temp and rain, you may not need to display how 
close it is on each dimension separately, but just how close it is to 
the ideal overall. Exactly how to compute this would vary based on the 
data (e.g., standardizing the values and taking the euclidean distance 
from the ideal).
	Your temp/rainfall example caught my eye because a few years ago I did 
a blog post on a similar topic, considering temperature and humidity 
(http://iq.brenbarn.net/2011/11/18/good-days-mate/). There I decided to 
graph just a single variable, namely the number of days on which either 
temperature *or* humidity is outside a "comfortable" range. Obviously 
this approach may not make sense for every situation. But what I mean 
is that, in some cases, you can use domain-specific knowledge about what 
the dimensions mean to combine them into one dimension that approximates 
what it is you're trying to illustrate with the graph.
-- 
Brendan Barnwell
"Do not follow where the path may lead. Go, instead, where there is no 
path, and leave a trail."
 --author unknown
From: peter <com...@ya...> - 2015年07月09日 16:49:32
On 07/09/2015 06:40 PM, peter wrote:
> hi,
>
> my code was working fine, but now i cant figure out what went wrong.
> any ideas?
>
> the code is supposed to plot a timeseries which it does and overlay it 
> with another that is partially defined
> the input file is contructed like this:
> the first line is just for information purposes.
> after that:
> the first row is a growing number (the x value), the second is the 
> timeseries and the third is the partially defined second timeseries
>
> this is the code, after the code is a example input file.
> the code is also accessible via this paste service: 
> https://dpaste.de/5ZrX it got a nice python code formatter.
>
ups, the last mail had a leading number from dpaste, this is the code 
without:
def plotTimeSeriesAndSAX(inputfile_tmp, verbose=False):
 if verbose:
 print "plotTimeSeriesAndSAX()"
 print "\tinputfile:", inputfile_tmp
 print "\toutputfile: %s.png" % inputfile_tmp
 inputfile = open(inputfile_tmp, "r");
 # this holds my timeseries
 x = []
 y = []
 # this holds my "pattern"
 pattern_x_values = []
 pattern_y_values = []
 # these are for temporary use only, hold the current pattern data
 tmp_x = []
 tmp_y = []
 # remove pattern/sax string, sax_string_with_Z from the datafile, 
only used as text in the plot
 first_line = inputfile.readline()
 pattern, sax, sax_string_with_Z = first_line.split()
 for line in inputfile.readlines():
 data = line.split()
 x_data = data[0]
 y_data = data[1]
 #if there is a third line (pattern at this position)
 if len(data) == 3:
 y2_data = data[2]
 tmp_y.append(y2_data)
 tmp_x.append(x_data)
 else:
 # if the pattern ends, add it to pattern_x/y_value and 
clear the tmp list
 if len(tmp_x) != 0:
 pattern_x_values.append(tmp_x)
 pattern_y_values.append(tmp_y)
 tmp_x = []
 tmp_y = []
 x.append(x_data)
 y.append(y_data)
 #if pattern == "ccd":
 # print "pattern x_values:", pattern_x_values
 # print "pattern y_values:", pattern_y_values
 if verbose:
 print "\ttimeseries y value", y
 print "pattern x_values:", pattern_x_values
 print "pattern y_values:", pattern_y_values
 colors = ["red", "magenta", "mediumblue", "darkorchid", "grey"]
 #linestyle = ["-", "--"]
 # without this, the second plot contains the first and the second
 # the third plot contains: the first, second and third
 plot.clf()
 # plot all my patterns into the plot
 for s in range(0,len(pattern_x_values)):
 #if verbose:
 # print "\tpattern x value:", pattern_x_values[s]
 # print "\tpattern y value:", pattern_y_values[s]
 plot.plot(pattern_x_values[s], pattern_y_values[s], colors[1])
 #plot.plot(x_all[0], y_all[0])
 import matplotlib.patches as mpatches
 #red_patch = mpatches.Patch(color='red', label='The red data')
 from time import gmtime, strftime
 current_date = strftime("%Y-%m-%d %H:%M:%S", gmtime())
 fig = plot.figure()
 fig.text(0, 0, 'bottom-left corner')
 fig.text(0, 1, current_date, ha='left', va='top')
 mytext = "pattern: %s sax: %s sax with Z: %s" % (pattern, sax, 
sax_string_with_Z)
 fig.text(1,1, mytext )
 # add the original timeseries to the plot
 plot.plot(x,y, "forestgreen")
 #if pattern == "ccd":
 # plot.show()
 directory, filename = os.path.split(inputfile_tmp)
 plot.savefig(os.path.join(directory, "plots/%s.png" % filename))#, 
bbox_inches='tight')
 # remove the last figure from memory
 #plot.close()
dee ccccccccccaacddeedcccccccdc ZZZZZZZZZZZZZZdeeZZZZZZZZZZ
1 -0.015920084
2 -0.044660769
3 -0.044660769
4 -0.092561907
5 0.012820599
6 -0.015920084
7 0.012820599
8 -0.054240996
9 0.031981054
10 0.031981054
11 -0.025500313
12 -0.044660769
13 0.012820599
14 -0.025500313
15 0.0032403709
16 -0.006339857
17 0.0032403709
18 -0.025500313
19 0.031981054
20 0.031981054
21 0.031981054
22 0.022400826
23 0.031981054
24 0.05114151
25 0.079882193
26 0.05114151
27 0.05114151
28 0.05114151
29 0.099042646
30 0.060721738
31 -0.015920084
32 -0.054240996
33 0.23316584
34 0.26190652
35 0.37686926
36 0.12778333
37 -0.044660769
38 -0.26500601
39 -0.41828965
40 -0.38954897
41 -0.26500601
42 -0.14046305
43 -0.073401452
44 -0.12130259
45 -0.082981679
46 -0.14046305
47 -0.054240996
48 -0.082981679
49 -0.015920084
50 -0.073401452
51 -0.015920084
52 0.10862288
53 1.1816084
54 -1.3379915
55 -4.6335899
56 -6.74124
57 -4.7772933
58 -3.4839626
59 -2.075669
60 -1.0984858
61 -0.37038851
62 -0.063821223
63 0.11820311
64 0.13736356
65 0.15652401
66 0.11820311
67 0.32896812
68 0.27148675
69 0.30022744
70 0.31938789
71 0.3577088 0.5449999999999999
72 0.40560994 0.5449999999999999
73 0.44393085 0.5449999999999999
74 0.49183198 0.5449999999999999
75 0.67385632 0.5449999999999999
76 0.79839928 0.84
77 0.9995841 0.84
78 1.1528677 0.84
79 1.4115338 0.84
80 1.5552373 0.84
81 1.7468418 0.84
82 1.7755825 0.84
83 1.7276813 0.84
84 1.4115338 0.84
85 1.0858061 0.84
86 0.65469586
87 0.43435063
88 0.21400538
89 0.14694379
90 0.089462421
91 0.070301966
92 0.031981054
93 0.05114151
94 0.070301966
95 0.13736356
96 0.079882193
97 0.12778333
98 0.15652401
99 0.16610425
100 0.13736356
101 0.13736356
102 0.089462421
103 0.2523263
104 0.21400538
105 0.22358561
106 0.1852647
107 0.19484493
108 0.1852647
109 0.16610425
110 0.13736356
111 0.15652401
112 0.14694379
113 0.16610425
114 0.099042646
115 0.12778333
116 0.13736356
117 0.089462421
118 0.079882193
119 0.089462421
120 0.041561282
121 0.041561282
122 0.079882193
123 0.11820311
124 0.099042646
125 0.089462421
126 0.05114151
127 0.17568447
128 0.30022744
129 0.32896812
130 0.42477039
131 0.17568447
132 0.022400826
133 -0.20752464
134 -0.24584556
135 -0.24584556
From: Mark B. <ma...@gm...> - 2015年07月09日 16:41:52
Fails on MacOSX backend.
Just tried it, and it works fine with the QT backend.
So I guess a MacOSX bug...
Thanks for your help,
Mark
On Thu, Jul 9, 2015 at 6:18 PM, Sterling Smith <sm...@fu...>
wrote:
> Works for me with TkAgg backend on 1.4.3.
>
> -Sterling
>
> On Jul 9, 2015, at 3:52AM, Mark Bakker <ma...@gm...> wrote:
>
> > Hello list,
> >
> > I am trying to set the backgroundcolor of a textbox:
> >
> > from pylab import *
> > plot([1, 2, 3])
> > text(1, 2, 'Hello', backgroundcolor = 'red')
> >
> > This plots a nice red box but no text. It looks like the backgroundcolor
> is set as the foreground. Am I doing something wrong or is this a bug? mpl
> version 1.4.3
> >
> > Thanks, Mark
> >
> >
> ------------------------------------------------------------------------------
> > Don't Limit Your Business. Reach for the Cloud.
> > GigeNET's Cloud Solutions provide you with the tools and support that
> > you need to offload your IT needs and focus on growing your business.
> > Configured For All Businesses. Start Your Cloud Today.
> >
> https://www.gigenetcloud.com/_______________________________________________
> > Matplotlib-users mailing list
> > Mat...@li...
> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
From: peter <com...@ya...> - 2015年07月09日 16:41:52
hi,
my code was working fine, but now i cant figure out what went wrong.
any ideas?
the code is supposed to plot a timeseries which it does and overlay it 
with another that is partially defined
the input file is contructed like this:
the first line is just for information purposes.
after that:
the first row is a growing number (the x value), the second is the 
timeseries and the third is the partially defined second timeseries
this is the code, after the code is a example input file.
the code is also accessible via this paste service: 
https://dpaste.de/5ZrX it got a nice python code formatter.
 1. def plotTimeSeriesAndSAX(inputfile_tmp, verbose=False):
 2.
 3. if verbose:
 4. print "plotTimeSeriesAndSAX()"
 5. print "\tinputfile:", inputfile_tmp
 6. print "\toutputfile: %s.png" % inputfile_tmp
 7.
 8. inputfile = open(inputfile_tmp, "r");
 9.
10.
11. # this holds my timeseries
12. x = []
13. y = []
14.
15. # this holds my "pattern"
16. pattern_x_values = []
17. pattern_y_values = []
18.
19. # these are for temporary use only, hold the current pattern data
20. tmp_x = []
21. tmp_y = []
22.
23.
24. # remove pattern/sax string, sax_string_with_Z from the datafile,
 only used as text in the plot
25. first_line = inputfile.readline()
26. pattern, sax, sax_string_with_Z = first_line.split()
27.
28.
29.
30.
31. for line in inputfile.readlines():
32.
33. data = line.split()
34. x_data = data[0]
35. y_data = data[1]
36.
37. #if there is a third line (pattern at this position)
38. if len(data) == 3:
39. y2_data = data[2]
40. tmp_y.append(y2_data)
41. tmp_x.append(x_data)
42. else:
43. # if the pattern ends, add it to pattern_x/y_value and clear the tmp
 list
44. if len(tmp_x) != 0:
45. pattern_x_values.append(tmp_x)
46. pattern_y_values.append(tmp_y)
47. tmp_x = []
48. tmp_y = []
49.
50.
51. x.append(x_data)
52. y.append(y_data)
53.
54. #if pattern == "ccd":
55. # print "pattern x_values:", pattern_x_values
56. # print "pattern y_values:", pattern_y_values
57. if verbose:
58. print "\ttimeseries y value", y
59. print "pattern x_values:", pattern_x_values
60. print "pattern y_values:", pattern_y_values
61.
62.
63.
64. colors = ["red", "magenta", "mediumblue", "darkorchid", "grey"]
65. #linestyle = ["-", "--"]
66.
67. # without this, the second plot contains the first and the second
68. # the third plot contains: the first, second and third
69. plot.clf()
70.
71. # plot all my patterns into the plot
72. for s in range(0,len(pattern_x_values)):
73. #if verbose:
74. # print "\tpattern x value:", pattern_x_values[s]
75. # print "\tpattern y value:", pattern_y_values[s]
76.
77. plot.plot(pattern_x_values[s], pattern_y_values[s], colors[1])
78.
79.
80. #plot.plot(x_all[0], y_all[0])
81.
82.
83. import matplotlib.patches as mpatches
84.
85.
86. #red_patch = mpatches.Patch(color='red', label='The red data')
87.
88. from time import gmtime, strftime
89. current_date = strftime("%Y-%m-%d%H:%M:%S", gmtime())
90.
91.
92. fig = plot.figure()
93.
94.
95. fig.text(0, 0, 'bottom-left corner')
96. fig.text(0, 1, current_date, ha='left', va='top')
97. mytext = "pattern: %ssax: %ssax with Z: %s" % (pattern, sax,
 sax_string_with_Z)
98. fig.text(1,1, mytext )
99.
100.
101. # add the original timeseries to the plot
102. plot.plot(x,y, "forestgreen")
103. #if pattern == "ccd":
104. # plot.show()
105.
106.
107. directory, filename = os.path.split(inputfile_tmp)
108.
109. plot.savefig(os.path.join(directory, "plots/%s.png" % filename))#,
 bbox_inches='tight')
110. # remove the last figure from memory
111. #plot.close()
112.
113.
114.
115.
116.
117.
118.
119.
120. #input:
121. dee ccccccccccaacddeedcccccccdc ZZZZZZZZZZZZZZdeeZZZZZZZZZZ
122. 1 -0.015920084
123. 2 -0.044660769
124. 3 -0.044660769
125. 4 -0.092561907
126. 5 0.012820599
127. 6 -0.015920084
128. 7 0.012820599
129. 8 -0.054240996
130. 9 0.031981054
131. 10 0.031981054
132. 11 -0.025500313
133. 12 -0.044660769
134. 13 0.012820599
135. 14 -0.025500313
136. 15 0.0032403709
137. 16 -0.006339857
138. 17 0.0032403709
139. 18 -0.025500313
140. 19 0.031981054
141. 20 0.031981054
142. 21 0.031981054
143. 22 0.022400826
144. 23 0.031981054
145. 24 0.05114151
146. 25 0.079882193
147. 26 0.05114151
148. 27 0.05114151
149. 28 0.05114151
150. 29 0.099042646
151. 30 0.060721738
152. 31 -0.015920084
153. 32 -0.054240996
154. 33 0.23316584
155. 34 0.26190652
156. 35 0.37686926
157. 36 0.12778333
158. 37 -0.044660769
159. 38 -0.26500601
160. 39 -0.41828965
161. 40 -0.38954897
162. 41 -0.26500601
163. 42 -0.14046305
164. 43 -0.073401452
165. 44 -0.12130259
166. 45 -0.082981679
167. 46 -0.14046305
168. 47 -0.054240996
169. 48 -0.082981679
170. 49 -0.015920084
171. 50 -0.073401452
172. 51 -0.015920084
173. 52 0.10862288
174. 53 1.1816084
175. 54 -1.3379915
176. 55 -4.6335899
177. 56 -6.74124
178. 57 -4.7772933
179. 58 -3.4839626
180. 59 -2.075669
181. 60 -1.0984858
182. 61 -0.37038851
183. 62 -0.063821223
184. 63 0.11820311
185. 64 0.13736356
186. 65 0.15652401
187. 66 0.11820311
188. 67 0.32896812
189. 68 0.27148675
190. 69 0.30022744
191. 70 0.31938789
192. 71 0.3577088 0.5449999999999999
193. 72 0.40560994 0.5449999999999999
194. 73 0.44393085 0.5449999999999999
195. 74 0.49183198 0.5449999999999999
196. 75 0.67385632 0.5449999999999999
197. 76 0.79839928 0.84
198. 77 0.9995841 0.84
199. 78 1.1528677 0.84
200. 79 1.4115338 0.84
201. 80 1.5552373 0.84
202. 81 1.7468418 0.84
203. 82 1.7755825 0.84
204. 83 1.7276813 0.84
205. 84 1.4115338 0.84
206. 85 1.0858061 0.84
207. 86 0.65469586
208. 87 0.43435063
209. 88 0.21400538
210. 89 0.14694379
211. 90 0.089462421
212. 91 0.070301966
213. 92 0.031981054
214. 93 0.05114151
215. 94 0.070301966
216. 95 0.13736356
217. 96 0.079882193
218. 97 0.12778333
219. 98 0.15652401
220. 99 0.16610425
221. 100 0.13736356
222. 101 0.13736356
223. 102 0.089462421
224. 103 0.2523263
225. 104 0.21400538
226. 105 0.22358561
227. 106 0.1852647
228. 107 0.19484493
229. 108 0.1852647
230. 109 0.16610425
231. 110 0.13736356
232. 111 0.15652401
233. 112 0.14694379
234. 113 0.16610425
235. 114 0.099042646
236. 115 0.12778333
237. 116 0.13736356
238. 117 0.089462421
239. 118 0.079882193
240. 119 0.089462421
241. 120 0.041561282
242. 121 0.041561282
243. 122 0.079882193
244. 123 0.11820311
245. 124 0.099042646
246. 125 0.089462421
247. 126 0.05114151
248. 127 0.17568447
249. 128 0.30022744
250. 129 0.32896812
251. 130 0.42477039
252. 131 0.17568447
253. 132 0.022400826
254. 133 -0.20752464
255. 134 -0.24584556
256. 135 -0.24584556
From: Sterling S. <sm...@fu...> - 2015年07月09日 16:19:09
Works for me with TkAgg backend on 1.4.3.
-Sterling
On Jul 9, 2015, at 3:52AM, Mark Bakker <ma...@gm...> wrote:
> Hello list,
> 
> I am trying to set the backgroundcolor of a textbox:
> 
> from pylab import *
> plot([1, 2, 3])
> text(1, 2, 'Hello', backgroundcolor = 'red')
> 
> This plots a nice red box but no text. It looks like the backgroundcolor is set as the foreground. Am I doing something wrong or is this a bug? mpl version 1.4.3
> 
> Thanks, Mark
> 
> ------------------------------------------------------------------------------
> Don't Limit Your Business. Reach for the Cloud.
> GigeNET's Cloud Solutions provide you with the tools and support that
> you need to offload your IT needs and focus on growing your business.
> Configured For All Businesses. Start Your Cloud Today.
> https://www.gigenetcloud.com/_______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Benjamin R. <ben...@ou...> - 2015年07月09日 14:52:21
Which backend are you using? It works fine for me with a recent-ish master
using Qt4Agg backend.
Ben Root
On Thu, Jul 9, 2015 at 6:52 AM, Mark Bakker <ma...@gm...> wrote:
> Hello list,
>
> I am trying to set the backgroundcolor of a textbox:
>
> from pylab import *
> plot([1, 2, 3])
> text(1, 2, 'Hello', backgroundcolor = 'red')
>
> This plots a nice red box but no text. It looks like the backgroundcolor
> is set as the foreground. Am I doing something wrong or is this a bug? mpl
> version 1.4.3
>
> Thanks, Mark
>
>
>
> ------------------------------------------------------------------------------
> Don't Limit Your Business. Reach for the Cloud.
> GigeNET's Cloud Solutions provide you with the tools and support that
> you need to offload your IT needs and focus on growing your business.
> Configured For All Businesses. Start Your Cloud Today.
> https://www.gigenetcloud.com/
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
From: Benjamin R. <ben...@ou...> - 2015年07月09日 14:46:42
why not use MathJax?
On Thu, Jul 9, 2015 at 8:03 AM, asiga <asi...@ya...> wrote:
> Hi,
>
> I need to render LaTeX math formulas on mobile apps (iOS/Android), with
> high
> quality, and as efficiently as possible.
>
> I'm considering matplotlib as the best candidate at the moment. Maybe it
> might be a bit overkill because I don't need plotting, just math formulas
> rendering, but it has a "copycenter" license (very welcome when you target
> iOS), and it seems to render LaTeX math with high quality. So I think it
> beats other options I found (MathGL: copyleft license; and MathJax: setting
> a complete Javascript engine just for rendering math does seem overkill to
> me).
>
> However, I still have some doubts before choosing matplotlib:
>
> 1) Can I redirect the output of math rendering to OpenGL calls, or convert
> it into a 2D triangle mesh for example? (if the drawing commands issued by
> matplotlib when rendering math are a relatively small set, I can translate
> them to OpenGL myself, but I need to know where should I do that
> translation
> (I've zero idea about matplotlib internals, and I'm a Python newbie -I'm
> here because I need math rendering, not because I use Python).
>
> (note that I wish to render through OpenGL because I want to be able to
> interactively pan and zoom math very efficiently: the best approach would
> be
> to cache the matplotlib output as a -for example- 2D triangle mesh, and
> then
> just send the triangles to OpenGL, without having to call matplotlib on
> each
> screen redraw, which would kill performance)
>
> 2) In order to get matplotlib running as efficient as possible on mobile
> devices, would you recommend that I translate matplotlib to C/C++ using any
> of the translators available? If affirmative, what translator would you
> suggest me to use?
>
> Thanks a lot!!
>
>
>
>
>
> --
> View this message in context:
> http://matplotlib.1069221.n5.nabble.com/Efficient-matplotlib-use-on-iOS-and-Android-apps-tp45901.html
> Sent from the matplotlib - users mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> Don't Limit Your Business. Reach for the Cloud.
> GigeNET's Cloud Solutions provide you with the tools and support that
> you need to offload your IT needs and focus on growing your business.
> Configured For All Businesses. Start Your Cloud Today.
> https://www.gigenetcloud.com/
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Jonno <jon...@gm...> - 2015年07月09日 14:44:32
It might just have to be 2 separate contour/surface plots side by side,
perhaps with a linked cursor between them.
The other thing I considered was combining the a,b data into a single value
(combined % deviation from ideal?) but that reduces the data which I'd
rather not do if possible.
On Thu, Jul 9, 2015 at 9:40 AM, Jonno <jon...@gm...> wrote:
> I was thinking of doing that or having 2 surface plots but I think it
> would be visually quite confusing.
> I was trying to think of an example since I'm sure someone has come up
> with a nice way to display this kind of data.
> Imagine if the data was average temperature (a) and average rainfall (b)
> for a region in the world (lat/long = x,y). The goal is to display the data
> such that it's obvious where the locations are that have closest to the
> ideal temp/rain combination.
> How would you go about that?
>
> On Thu, Jul 9, 2015 at 12:28 AM, Sterling Smith <sm...@fu...>
> wrote:
>
>> In the x,y plane, could you overlay contours of a with contours of b?
>> -Sterling
>>
>> On Jul 8, 2015, at 8:19PM, Jonno <jon...@gm...> wrote:
>>
>> > I have a bunch of experimental data points each of which has 2
>> variables (x,y) and 2 results (a,b). Each pair or x,y values produces a
>> pair of a,b resultant values.
>> > There is a single optimal pair of a,b values and I'd like to figure out
>> a way to illustrate the data to show the relationship between each x,y pair
>> and how close each a,b pair is to the ideal.
>> > I'm thinking about a dual surface/contour plot with 2 different z-axes.
>> Ideally I would center both z-axes at the ideal values. I don't know if
>> this is possible. Might be kinda messy.
>> >
>> > Any other thoughts? I'm sure there must be other examples where this is
>> a problem.
>> >
>> ------------------------------------------------------------------------------
>> > Don't Limit Your Business. Reach for the Cloud.
>> > GigeNET's Cloud Solutions provide you with the tools and support that
>> > you need to offload your IT needs and focus on growing your business.
>> > Configured For All Businesses. Start Your Cloud Today.
>> >
>> https://www.gigenetcloud.com/_______________________________________________
>> > Matplotlib-users mailing list
>> > Mat...@li...
>> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>>
>
From: Jonno <jon...@gm...> - 2015年07月09日 14:40:51
I was thinking of doing that or having 2 surface plots but I think it would
be visually quite confusing.
I was trying to think of an example since I'm sure someone has come up with
a nice way to display this kind of data.
Imagine if the data was average temperature (a) and average rainfall (b)
for a region in the world (lat/long = x,y). The goal is to display the data
such that it's obvious where the locations are that have closest to the
ideal temp/rain combination.
How would you go about that?
On Thu, Jul 9, 2015 at 12:28 AM, Sterling Smith <sm...@fu...>
wrote:
> In the x,y plane, could you overlay contours of a with contours of b?
> -Sterling
>
> On Jul 8, 2015, at 8:19PM, Jonno <jon...@gm...> wrote:
>
> > I have a bunch of experimental data points each of which has 2 variables
> (x,y) and 2 results (a,b). Each pair or x,y values produces a pair of a,b
> resultant values.
> > There is a single optimal pair of a,b values and I'd like to figure out
> a way to illustrate the data to show the relationship between each x,y pair
> and how close each a,b pair is to the ideal.
> > I'm thinking about a dual surface/contour plot with 2 different z-axes.
> Ideally I would center both z-axes at the ideal values. I don't know if
> this is possible. Might be kinda messy.
> >
> > Any other thoughts? I'm sure there must be other examples where this is
> a problem.
> >
> ------------------------------------------------------------------------------
> > Don't Limit Your Business. Reach for the Cloud.
> > GigeNET's Cloud Solutions provide you with the tools and support that
> > you need to offload your IT needs and focus on growing your business.
> > Configured For All Businesses. Start Your Cloud Today.
> >
> https://www.gigenetcloud.com/_______________________________________________
> > Matplotlib-users mailing list
> > Mat...@li...
> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
From: asiga <asi...@ya...> - 2015年07月09日 12:03:52
Hi,
I need to render LaTeX math formulas on mobile apps (iOS/Android), with high
quality, and as efficiently as possible.
I'm considering matplotlib as the best candidate at the moment. Maybe it
might be a bit overkill because I don't need plotting, just math formulas
rendering, but it has a "copycenter" license (very welcome when you target
iOS), and it seems to render LaTeX math with high quality. So I think it
beats other options I found (MathGL: copyleft license; and MathJax: setting
a complete Javascript engine just for rendering math does seem overkill to
me).
However, I still have some doubts before choosing matplotlib:
1) Can I redirect the output of math rendering to OpenGL calls, or convert
it into a 2D triangle mesh for example? (if the drawing commands issued by
matplotlib when rendering math are a relatively small set, I can translate
them to OpenGL myself, but I need to know where should I do that translation
(I've zero idea about matplotlib internals, and I'm a Python newbie -I'm
here because I need math rendering, not because I use Python).
(note that I wish to render through OpenGL because I want to be able to
interactively pan and zoom math very efficiently: the best approach would be
to cache the matplotlib output as a -for example- 2D triangle mesh, and then
just send the triangles to OpenGL, without having to call matplotlib on each
screen redraw, which would kill performance)
2) In order to get matplotlib running as efficient as possible on mobile
devices, would you recommend that I translate matplotlib to C/C++ using any
of the translators available? If affirmative, what translator would you
suggest me to use?
Thanks a lot!!
 
--
View this message in context: http://matplotlib.1069221.n5.nabble.com/Efficient-matplotlib-use-on-iOS-and-Android-apps-tp45901.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Mark B. <ma...@gm...> - 2015年07月09日 10:52:51
Hello list,
I am trying to set the backgroundcolor of a textbox:
from pylab import *
plot([1, 2, 3])
text(1, 2, 'Hello', backgroundcolor = 'red')
This plots a nice red box but no text. It looks like the backgroundcolor is
set as the foreground. Am I doing something wrong or is this a bug? mpl
version 1.4.3
Thanks, Mark
From: Sterling S. <sm...@fu...> - 2015年07月09日 05:28:11
In the x,y plane, could you overlay contours of a with contours of b?
-Sterling
On Jul 8, 2015, at 8:19PM, Jonno <jon...@gm...> wrote:
> I have a bunch of experimental data points each of which has 2 variables (x,y) and 2 results (a,b). Each pair or x,y values produces a pair of a,b resultant values.
> There is a single optimal pair of a,b values and I'd like to figure out a way to illustrate the data to show the relationship between each x,y pair and how close each a,b pair is to the ideal.
> I'm thinking about a dual surface/contour plot with 2 different z-axes. Ideally I would center both z-axes at the ideal values. I don't know if this is possible. Might be kinda messy.
> 
> Any other thoughts? I'm sure there must be other examples where this is a problem.
> ------------------------------------------------------------------------------
> Don't Limit Your Business. Reach for the Cloud.
> GigeNET's Cloud Solutions provide you with the tools and support that
> you need to offload your IT needs and focus on growing your business.
> Configured For All Businesses. Start Your Cloud Today.
> https://www.gigenetcloud.com/_______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Jonno <jon...@gm...> - 2015年07月09日 03:19:44
I have a bunch of experimental data points each of which has 2 variables
(x,y) and 2 results (a,b). Each pair or x,y values produces a pair of a,b
resultant values.
There is a single optimal pair of a,b values and I'd like to figure out a
way to illustrate the data to show the relationship between each x,y pair
and how close each a,b pair is to the ideal.
I'm thinking about a dual surface/contour plot with 2 different z-axes.
Ideally I would center both z-axes at the ideal values. I don't know if
this is possible. Might be kinda messy.
Any other thoughts? I'm sure there must be other examples where this is a
problem.

Showing 15 results of 15

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