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
|
|
From: Todamont <re...@un...> - 2013-01-27 10:28:05
|
Hmmmmm. This stretches the background image (mhd data) to fit, leaving the
price line-plot not lining up with the background density plot. Now I have
to figure out how to make the density plot scale to fit...
--
View this message in context: http://matplotlib.1069221.n5.nabble.com/Matplotlib-INSISTS-on-using-scientific-notation-how-do-I-make-it-STOP-tp40320p40330.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
|
|
From: Todamont <re...@un...> - 2013-01-27 08:54:07
|
for the record I had to put the buffer on the set_limit commands, not the "extent" of the image, like so: priceDiff = max(price)-min(price) diffQuant = priceDiff / 4 minQuant = min(price)-diffQuant maxQuant = max(price)+diffQuant pl.set_ylim([minQuant,maxQuant]) and also include: pl.set_xlim([min(date),max(date)]) to get it working just right. Just for posterity. Thanks again~ -- View this message in context: http://matplotlib.1069221.n5.nabble.com/Matplotlib-INSISTS-on-using-scientific-notation-how-do-I-make-it-STOP-tp40320p40329.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
|
From: Todamont <re...@un...> - 2013-01-27 07:06:50
|
Thank you! Success! Yeah, I learned a little from this little exercise. I will set the "extent" on the image to include a buffer in the y-axis, a certain percentage of max(price)-min(price), for some durations. If there is only a single trade during any duration, well... I need handle that as a special case, now that you mention it. It doesn't like that, basically. I need to go back and get the second-latest trade, and plot it *outside* the graph, or some variant or hack of that, so that it draws a line to the most recent trade, and then create another artificial point at the same price at the current time, to indicate a flat market... Thanks again for your help. I've been at wit's end trying to fix that... Cheers~ -- View this message in context: http://matplotlib.1069221.n5.nabble.com/Matplotlib-INSISTS-on-using-scientific-notation-how-do-I-make-it-STOP-tp40320p40328.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
|
From: Eric F. <ef...@ha...> - 2013-01-27 06:39:40
|
On 2013/01/26 7:59 PM, Todamont wrote: > Ok, here is the distilled code that displays the scientific formatting > failure I'm trying to fix. I had to wait until the market gave me a snapshot > that triggered this bug. Here is a quick link to the image I get when I run > this program: http://imgur.com/77DUbZp What you were seeing is not an exponent, it is an offset. The attached modification tells mpl not to use an offset, and it also simplifies things by omitting the twinx, which is not needed, and by omitting all the extra fussing with formatters, likewise not needed. The algorithm for automatically choosing an offset (when an offset is desired) is known to be over-eager, but it turns out to be surprisingly difficult to come up with a better algorithm that works in a wide range of circumstances. Now, are you sure you really always want to set the y limits to exactly your y data limits? You will never have only a single point? Or only identical y values? Eric > > I greatly appreciate your help with this. Any suggestions are welcome. Also, > this code will become FOSS when it is completed. Do you think it is related > to the way I'm loading in the data with the "extent" command and then making > a subplot? I'm generating a custom heatmap of the market density for the > background, so I sort of need that... > > #!/usr/bin/env python2.7 > # coding: utf-8 > import matplotlib > from matplotlib.figure import Figure > from matplotlib.backends.backend_agg import FigureCanvasAgg > from datetime import datetime > import matplotlib.dates as dates > import matplotlib.pyplot as plt > import numpy as np > from matplotlib.ticker import ScalarFormatter, FormatStrFormatter, > FuncFormatter > import matplotlib.image as mpimg > > date = [ 734894.994583, 734894.995313, 734894.996042, 734894.997384, > 734894.998032 ] > price = [ 17.37, 17.30001, 17.30001, 17.39, 17.39 ] > graphdate = [] > for i in date: > graphdate.append(i) > > graph = np.zeros((100,100,3)) > fig=Figure(figsize=(5.5,2.4)) > pl=fig.add_subplot(111) > image=pl.imshow(graph,aspect="auto",extent=(min(date),max(date),min(price),max(price))) > fig.subplots_adjust(top=0.92,bottom=0.15,left=0.1,right=0.95) > > # add plot of value across time > pl.plot_date(zip(graphdate),zip(price),'-',color='blue',lw='1',alpha=1) > matplotlib.rcParams.update({'font.size': 5}) > > locator = dates.AutoDateLocator() > pl.set_ylim([min(price),max(price)]) > ax2=pl.twinx() > ax2.set_ylim([min(price),max(price)]) > > formatter = ScalarFormatter() > formatter.set_scientific(False) > formatter.set_powerlimits((-1000000000,10000)) > pl.yaxis.set_major_formatter(FuncFormatter(lambda x, pos: '%.0f'%x)) > pl.yaxis.set_major_formatter(formatter) > pl.yaxis.set_minor_formatter(FuncFormatter(lambda x, pos: '%.0f'%x)) > pl.yaxis.set_minor_formatter(formatter) > pl.set_autoscaley_on(False) > yfm = pl.yaxis.get_major_formatter() > yfm.set_powerlimits([ -100000000000, 10000]) > > ax2.yaxis.set_major_formatter(formatter) > ax2.yaxis.set_major_formatter(ScalarFormatter(useOffset=False)) > ax2.yaxis.set_major_formatter(FuncFormatter(lambda x, pos: '%.0f'%x)) > ax2.yaxis.set_major_formatter(formatter) > ax2.yaxis.set_minor_formatter(ScalarFormatter(useOffset=False)) > ax2.yaxis.set_minor_formatter(FuncFormatter(lambda x, pos: '%.0f'%x)) > ax2.yaxis.set_major_formatter(formatter) > ax2.set_autoscaley_on(False) > yfm = ax2.yaxis.get_major_formatter() > yfm.set_powerlimits([ -100000000000, 10000]) > > period = 298; # duration in seconds for this graph > seconds = dates.SecondLocator(interval=30) # plot by 30-second increment > secondsFmt = dates.DateFormatter('%-I:%M:%S%P',tz=None) > pl.xaxis.set_major_locator(seconds) > pl.xaxis.set_major_formatter(secondsFmt) > > labels = pl.get_xticklabels() > for label in labels: > label.set_rotation(45) > > pl.xaxis.grid(which='major',color='white', linestyle='--', linewidth=0.5, > alpha=0.15) > pl.xaxis.grid(which='minor',color='white', linestyle='--', linewidth=0.5, > alpha=0.15) > pl.yaxis.grid(which='major',color='white', linestyle='--', linewidth=0.5, > alpha=0.15) > pl.yaxis.grid(which='minor',color='white', linestyle='--', linewidth=0.5, > alpha=0.15) > > canvas=FigureCanvasAgg(fig) > bigName = "sci_formatting_fail.png" # image name > canvas.print_figure(bigName,dpi=200) # create date/timestamped file > print "grapher completed" > > > > -- > View this message in context: http://matplotlib.1069221.n5.nabble.com/Matplotlib-INSISTS-on-using-scientific-notation-how-do-I-make-it-STOP-tp40320p40326.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > > ------------------------------------------------------------------------------ > Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, > MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current > with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft > MVPs and experts. ON SALE this month only -- learn more at: > http://p.sf.net/sfu/learnnow-d2d > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
|
From: Todamont <re...@un...> - 2013-01-27 05:59:08
|
Ok, here is the distilled code that displays the scientific formatting failure I'm trying to fix. I had to wait until the market gave me a snapshot that triggered this bug. Here is a quick link to the image I get when I run this program: http://imgur.com/77DUbZp I greatly appreciate your help with this. Any suggestions are welcome. Also, this code will become FOSS when it is completed. Do you think it is related to the way I'm loading in the data with the "extent" command and then making a subplot? I'm generating a custom heatmap of the market density for the background, so I sort of need that... #!/usr/bin/env python2.7 # coding: utf-8 import matplotlib from matplotlib.figure import Figure from matplotlib.backends.backend_agg import FigureCanvasAgg from datetime import datetime import matplotlib.dates as dates import matplotlib.pyplot as plt import numpy as np from matplotlib.ticker import ScalarFormatter, FormatStrFormatter, FuncFormatter import matplotlib.image as mpimg date = [ 734894.994583, 734894.995313, 734894.996042, 734894.997384, 734894.998032 ] price = [ 17.37, 17.30001, 17.30001, 17.39, 17.39 ] graphdate = [] for i in date: graphdate.append(i) graph = np.zeros((100,100,3)) fig=Figure(figsize=(5.5,2.4)) pl=fig.add_subplot(111) image=pl.imshow(graph,aspect="auto",extent=(min(date),max(date),min(price),max(price))) fig.subplots_adjust(top=0.92,bottom=0.15,left=0.1,right=0.95) # add plot of value across time pl.plot_date(zip(graphdate),zip(price),'-',color='blue',lw='1',alpha=1) matplotlib.rcParams.update({'font.size': 5}) locator = dates.AutoDateLocator() pl.set_ylim([min(price),max(price)]) ax2=pl.twinx() ax2.set_ylim([min(price),max(price)]) formatter = ScalarFormatter() formatter.set_scientific(False) formatter.set_powerlimits((-1000000000,10000)) pl.yaxis.set_major_formatter(FuncFormatter(lambda x, pos: '%.0f'%x)) pl.yaxis.set_major_formatter(formatter) pl.yaxis.set_minor_formatter(FuncFormatter(lambda x, pos: '%.0f'%x)) pl.yaxis.set_minor_formatter(formatter) pl.set_autoscaley_on(False) yfm = pl.yaxis.get_major_formatter() yfm.set_powerlimits([ -100000000000, 10000]) ax2.yaxis.set_major_formatter(formatter) ax2.yaxis.set_major_formatter(ScalarFormatter(useOffset=False)) ax2.yaxis.set_major_formatter(FuncFormatter(lambda x, pos: '%.0f'%x)) ax2.yaxis.set_major_formatter(formatter) ax2.yaxis.set_minor_formatter(ScalarFormatter(useOffset=False)) ax2.yaxis.set_minor_formatter(FuncFormatter(lambda x, pos: '%.0f'%x)) ax2.yaxis.set_major_formatter(formatter) ax2.set_autoscaley_on(False) yfm = ax2.yaxis.get_major_formatter() yfm.set_powerlimits([ -100000000000, 10000]) period = 298; # duration in seconds for this graph seconds = dates.SecondLocator(interval=30) # plot by 30-second increment secondsFmt = dates.DateFormatter('%-I:%M:%S%P',tz=None) pl.xaxis.set_major_locator(seconds) pl.xaxis.set_major_formatter(secondsFmt) labels = pl.get_xticklabels() for label in labels: label.set_rotation(45) pl.xaxis.grid(which='major',color='white', linestyle='--', linewidth=0.5, alpha=0.15) pl.xaxis.grid(which='minor',color='white', linestyle='--', linewidth=0.5, alpha=0.15) pl.yaxis.grid(which='major',color='white', linestyle='--', linewidth=0.5, alpha=0.15) pl.yaxis.grid(which='minor',color='white', linestyle='--', linewidth=0.5, alpha=0.15) canvas=FigureCanvasAgg(fig) bigName = "sci_formatting_fail.png" # image name canvas.print_figure(bigName,dpi=200) # create date/timestamped file print "grapher completed" -- View this message in context: http://matplotlib.1069221.n5.nabble.com/Matplotlib-INSISTS-on-using-scientific-notation-how-do-I-make-it-STOP-tp40320p40326.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
|
From: Eduardo B. T. <eeb...@uc...> - 2013-01-27 04:29:54
|
Hi Skipper, I think you are missing one bin in your plot... but anyway, this is how I'd do the same plot (filled step plot): import matplotlib.pyplot as plt import numpy as np t_sec = np.arange(6) velocity = np.array([24., 33., 40., 45., 48., 49.]) width = t_sec[1] - t_sec[0] plt.bar(t_sec, velocity, width=width, facecolor='b', edgecolor='') xx = np.ravel(zip(t_sec, t_sec + width)) yy = np.ravel(zip(velocity, velocity)) plt.plot(xx, yy, 'k') plt.show() I think this is a bit simpler Cheers, Eduardo Banados On Sun, Jan 27, 2013 at 12:35 AM, Skipper Seabold <jss...@gm...>wrote: > This has been asked before, and I just filed a ticket [1]. Can anyone > think of a better way to do something like this? The fill_between below is > pretty suboptimal IMO. > > import matplotlib.pyplot as plt > import numpy as np > > t_sec = np.arange(6) > velocity = np.array([24., 33., 40., 45., 48., 49.]) > > fig, ax = plt.subplots(figsize=(10,6)) > lines = ax.plot(t_sec, velocity, 'mo') > ax.margins(.01) > ax.grid(False) > ax.set_ylim(0, 53); > steps = ax.step(t_sec, velocity, where='post', color='black') > filed = ax.fill_between(np.linspace(0, 5, 1001), 0, > np.r_[np.repeat(velocity[:-1], 200), 5.]) > > Skipper > > [1] https://github.com/matplotlib/matplotlib/issues/1709 > > > ------------------------------------------------------------------------------ > Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, > MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current > with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft > MVPs and experts. ON SALE this month only -- learn more at: > http://p.sf.net/sfu/learnnow-d2d > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > -- Eduardo Bañados Torres |
|
From: Todamont <re...@un...> - 2013-01-27 03:51:00
|
I'm trying to boil this thing down to a simple example program for you, it's part of a big project so it's kind of tough, all the data is stored in RAM, never in files... It seems like there should be some way to just tell matplotlib to NEVER use scientific notation for the axes... I'd be willing to alter my matplotlibrc or even my matplotlib build itself, because this is the only application I use it for. I can't even seem to find the part of the code backend that is responsible for this weird behavior, though. -- View this message in context: http://matplotlib.1069221.n5.nabble.com/Matplotlib-INSISTS-on-using-scientific-notation-how-do-I-make-it-STOP-tp40320p40324.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
|
From: Eric F. <ef...@ha...> - 2013-01-27 03:47:24
|
On 2013/01/26 5:33 PM, Todamont wrote: > This is the relevant code: Thanks, but what would really help is not what you think is the relevant code, but a completely self-contained *minimal* script, so that I can run it as-is, then modify it (probably only slightly), and return the modified version. I suspect that using plot_date and a few fake data points, you can reproduce the problem. I doubt that it matters whether you use pyplot with an interactive backend, or use the OO form with FigureCanvasAgg. Eric > > import sys, shutil > import matplotlib > from matplotlib.figure import Figure > from matplotlib.backends.backend_agg import FigureCanvasAgg > from mhd_scipy import load_mhd > from datetime import datetime > import matplotlib.dates as dates > import matplotlib.pyplot as plt > import numpy as np > import matplotlib.font_manager > from matplotlib.ticker import ScalarFormatter, FormatStrFormatter, > FuncFormatter > > ... > > fig=Figure(figsize=(5.5,2.4)) > pl=fig.add_subplot(111) > > pl.plot_date(zip(graphdate),zip(price),'-',color='white',lw='0.5',alpha=0.25) > pl.set_ylim([min(price),max(price)]) > ax2=pl.twinx() > ax2.set_ylim([min(price),max(price)]) > > # here is my attempt to force NON-SCIENTIFIC axes > formatter = ScalarFormatter() > formatter.set_scientific(False) > formatter.set_powerlimits((-1000000000,10000)) > pl.yaxis.set_major_formatter(FuncFormatter(lambda x, pos: '%.0f'%x)) > pl.yaxis.set_major_formatter(formatter) > pl.yaxis.set_minor_formatter(FuncFormatter(lambda x, pos: '%.0f'%x)) > pl.yaxis.set_minor_formatter(formatter) > pl.set_autoscaley_on(False) > yfm = pl.yaxis.get_major_formatter() > yfm.set_powerlimits([ -100000000000, 10000]) > > #finally, render... > canvas=FigureCanvasAgg(fig) bigName = pyArgs[4] + "_big.png" # create > image name string.. > canvas.print_figure(bigName,dpi=200) # create date/timestamped file > print "Large line-graph Created" > > > So, if I pass this thing price data that includes only 1 trade, or just a > few trades that are within a cent or two of each other, that's when the > bizarre axis scaling happens... > > > > > > > -- > View this message in context: http://matplotlib.1069221.n5.nabble.com/Matplotlib-INSISTS-on-using-scientific-notation-how-do-I-make-it-STOP-tp40320p40322.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > > ------------------------------------------------------------------------------ > Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, > MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current > with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft > MVPs and experts. ON SALE this month only -- learn more at: > http://p.sf.net/sfu/learnnow-d2d > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
|
From: Todamont <re...@un...> - 2013-01-27 03:33:07
|
This is the relevant code: import sys, shutil import matplotlib from matplotlib.figure import Figure from matplotlib.backends.backend_agg import FigureCanvasAgg from mhd_scipy import load_mhd from datetime import datetime import matplotlib.dates as dates import matplotlib.pyplot as plt import numpy as np import matplotlib.font_manager from matplotlib.ticker import ScalarFormatter, FormatStrFormatter, FuncFormatter ... fig=Figure(figsize=(5.5,2.4)) pl=fig.add_subplot(111) pl.plot_date(zip(graphdate),zip(price),'-',color='white',lw='0.5',alpha=0.25) pl.set_ylim([min(price),max(price)]) ax2=pl.twinx() ax2.set_ylim([min(price),max(price)]) # here is my attempt to force NON-SCIENTIFIC axes formatter = ScalarFormatter() formatter.set_scientific(False) formatter.set_powerlimits((-1000000000,10000)) pl.yaxis.set_major_formatter(FuncFormatter(lambda x, pos: '%.0f'%x)) pl.yaxis.set_major_formatter(formatter) pl.yaxis.set_minor_formatter(FuncFormatter(lambda x, pos: '%.0f'%x)) pl.yaxis.set_minor_formatter(formatter) pl.set_autoscaley_on(False) yfm = pl.yaxis.get_major_formatter() yfm.set_powerlimits([ -100000000000, 10000]) #finally, render... canvas=FigureCanvasAgg(fig) bigName = pyArgs[4] + "_big.png" # create image name string.. canvas.print_figure(bigName,dpi=200) # create date/timestamped file print "Large line-graph Created" So, if I pass this thing price data that includes only 1 trade, or just a few trades that are within a cent or two of each other, that's when the bizarre axis scaling happens... -- View this message in context: http://matplotlib.1069221.n5.nabble.com/Matplotlib-INSISTS-on-using-scientific-notation-how-do-I-make-it-STOP-tp40320p40322.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
|
From: Eric F. <ef...@ha...> - 2013-01-27 03:24:10
|
On 2013/01/26 5:16 PM, Todamont wrote: > I'm charting financial data, so scientific notation is unwanted in ALL cases. > Sometimes if I pass it data with just a few trades right near each other, it > scales so the y-axis get set to some bizare exponent, like 1.7321e1. By the > way, why would anyone ever want a plot in scientific notation where the > exponent is not a power of 10? It makes absolutely no sense whatsoever that > it would do that, it is a bug. > > So, here is the code I'm trying to use to force matplotlib to NOT use > scientific notation on the y-axis, unsuccesfully: > > formatter = ScalarFormatter() > formatter.set_scientific(False) > formatter.set_powerlimits((-10000,10000)) > pl.yaxis.set_major_formatter(FuncFormatter(lambda x, pos: '%.0f'%x)) > pl.yaxis.set_major_formatter(formatter) > pl.yaxis.set_minor_formatter(FuncFormatter(lambda x, pos: '%.0f'%x)) > pl.yaxis.set_minor_formatter(formatter) > pl.set_autoscaley_on(False) > yfm = pl.yaxis.get_major_formatter() > yfm.set_powerlimits([ -10000, 10000]) > > > None of these attempts to turn off scientific notation is working. Any > suggestions? Please? Please provide a minimal script illustrating the problem, that is, triggering the unwanted axis handling. Eric > > > > -- > View this message in context: http://matplotlib.1069221.n5.nabble.com/Matplotlib-INSISTS-on-using-scientific-notation-how-do-I-make-it-STOP-tp40320.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > > ------------------------------------------------------------------------------ > Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, > MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current > with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft > MVPs and experts. ON SALE this month only -- learn more at: > http://p.sf.net/sfu/learnnow-d2d > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
|
From: Todamont <re...@un...> - 2013-01-27 03:16:22
|
I'm charting financial data, so scientific notation is unwanted in ALL cases. Sometimes if I pass it data with just a few trades right near each other, it scales so the y-axis get set to some bizare exponent, like 1.7321e1. By the way, why would anyone ever want a plot in scientific notation where the exponent is not a power of 10? It makes absolutely no sense whatsoever that it would do that, it is a bug. So, here is the code I'm trying to use to force matplotlib to NOT use scientific notation on the y-axis, unsuccesfully: formatter = ScalarFormatter() formatter.set_scientific(False) formatter.set_powerlimits((-10000,10000)) pl.yaxis.set_major_formatter(FuncFormatter(lambda x, pos: '%.0f'%x)) pl.yaxis.set_major_formatter(formatter) pl.yaxis.set_minor_formatter(FuncFormatter(lambda x, pos: '%.0f'%x)) pl.yaxis.set_minor_formatter(formatter) pl.set_autoscaley_on(False) yfm = pl.yaxis.get_major_formatter() yfm.set_powerlimits([ -10000, 10000]) None of these attempts to turn off scientific notation is working. Any suggestions? Please? -- View this message in context: http://matplotlib.1069221.n5.nabble.com/Matplotlib-INSISTS-on-using-scientific-notation-how-do-I-make-it-STOP-tp40320.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
|
From: Skipper S. <jss...@gm...> - 2013-01-26 23:36:14
|
This has been asked before, and I just filed a ticket [1]. Can anyone think of a better way to do something like this? The fill_between below is pretty suboptimal IMO. import matplotlib.pyplot as plt import numpy as np t_sec = np.arange(6) velocity = np.array([24., 33., 40., 45., 48., 49.]) fig, ax = plt.subplots(figsize=(10,6)) lines = ax.plot(t_sec, velocity, 'mo') ax.margins(.01) ax.grid(False) ax.set_ylim(0, 53); steps = ax.step(t_sec, velocity, where='post', color='black') filed = ax.fill_between(np.linspace(0, 5, 1001), 0, np.r_[np.repeat(velocity[:-1], 200), 5.]) Skipper [1] https://github.com/matplotlib/matplotlib/issues/1709 |
|
From: Eric F. <ef...@ha...> - 2013-01-25 22:29:43
|
On 2013/01/24 5:36 AM, Benjamin Root wrote: > > > On Thu, Jan 24, 2013 at 10:13 AM, Chao YUE <cha...@gm... > <mailto:cha...@gm...>> wrote: > > Dear all, > > I upgrade my matplotlib from 1.1.1 to 1.2.0 using the command: > > sudo pip-python install --upgrade matplotlib > > it completes successfully. However I tried to > > import matplotlib.pyplot as plt, I get the error: > > /usr/lib64/python2.7/site-packages/matplotlib/backends/backend_gdk.py in > <module>() > 27 from matplotlib.mathtext import MathTextParser > 28 from matplotlib.transforms import Affine2D > ---> 29 from matplotlib.backends._backend_gdk import > pixbuf_get_pixels_array > 30 > 31 backend_version = "%d.%d.%d" % gtk.pygtk_version > > > in my ~/.matplotlib/matplotlibrc, I am using: > backend : GTKAgg > > So what backend should I choose? thanks for any help, > > Chao > > > Did you have all of the gtk/gdk development packages installed? If the > installer can't find them to compile _backend_gdk.so, then it wouldn't > be made available in the install. As a work-around, you could always > use TkAgg, as that is a pure-python backend. No, we have a _tkagg.cpp. qt4agg and wxagg use no extension code beyond that for agg itself. Eric > > I hope that helps! > Ben Root |
|
From: Eric F. <ef...@ha...> - 2013-01-25 07:28:57
|
On 2013/01/22 11:50 PM, Andrew Dawson wrote: > Hi all, > > [TL;DR: is it possible to control the length of the dashes in dashed > contours, if so how?] > > I'd like to be able to control the length of dashes for dashed contours. > My motivation is that I'm making a contour plot that uses dashes for the > negative contours, and the plot needs to be a specific (small) size for > the particular journal, so the small size of the plot makes the dashes > look rather long and is a problem for some tight contours. > > I have tried using some a dashes-style argument for the linestyles > keyword of contour but I can't get it to work (although I appreciate it > is not documented as something one can do). For example I tried: > > import matplotlib.pyplot as plt > import numpy as np > x = y = np.linspace(-np.pi, np.pi, 100) > X, Y = np.meshgrid(x, y) > Z = np.sin(X) * np.cos(Y) > plt.contour(x, y, Z, linestyles=[(3, 3)]) > plt.show() > > This fails at the point where I show (or save, doesn't matter which > backend) the plot with a PyCXX error: > > TypeError: PyCXX: Error creating object of type > N2Py7SeqBaseINS_6ObjectEEE from 3 > > I've fiddled with several other styles of argument and all fail in a > similar way. There seems to be a nasty tangle of bugs and obsolete documentation here. It should be perfectly simple and straightforward, but it isn't. https://github.com/matplotlib/matplotlib/issues/1701 Eric > > What I'd like to know is: is it possible to control the dash length of > dashed contours at all? It seems like it should be as one can do this > with lines easy enough. I looked through the code, and a dashes-style > argument seems to get passed through the stack correctly, but fails when > the Collection is drawn. It would be a really nice feature if this could > be implemented in matplotlib. > > Thanks, > Andrew > > > ------------------------------------------------------------------------------ > Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, > MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current > with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft > MVPs and experts. ON SALE this month only -- learn more at: > http://p.sf.net/sfu/learnnow-d2d > > > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
|
From: Joshua K. <jjk...@gm...> - 2013-01-24 22:15:42
|
http://www.hotwheelsreview.com/wp-content/themes/twentyten/googlelook3394.php |
|
From: Chao Y. <cha...@gm...> - 2013-01-24 21:10:17
|
thanks Paul. You're right, I changed the setting, should work now. Chao On Thu, Jan 24, 2013 at 7:36 PM, Paul Hobson <pmh...@gm...> wrote: > On Thu, Jan 24, 2013 at 9:35 AM, Chao YUE <cha...@gm...> wrote: > >> Dear all, >> >> why I can only recieve the Matplotlib-users Digest, but not the email. >> Each time I need to go >> http://matplotlib.1069221.n5.nabble.com/matplotlib-users-f3.html to >> reply the the mail. >> I think I must miss something? >> >> Chao >> >> > I'm pretty sure that's a setting you selected during registration. Can you > log into the web portal to manage your subscription? > -paul > -- *********************************************************************************** Chao YUE Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL) UMR 1572 CEA-CNRS-UVSQ Batiment 712 - Pe 119 91191 GIF Sur YVETTE Cedex Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16 ************************************************************************************ |
|
From: Paul H. <pmh...@gm...> - 2013-01-24 18:36:13
|
On Thu, Jan 24, 2013 at 9:35 AM, Chao YUE <cha...@gm...> wrote: > Dear all, > > why I can only recieve the Matplotlib-users Digest, but not the email. > Each time I need to go > http://matplotlib.1069221.n5.nabble.com/matplotlib-users-f3.html to reply > the the mail. > I think I must miss something? > > Chao > > I'm pretty sure that's a setting you selected during registration. Can you log into the web portal to manage your subscription? -paul |
|
From: Chao Y. <cha...@gm...> - 2013-01-24 17:35:47
|
Dear all, why I can only recieve the Matplotlib-users Digest, but not the email. Each time I need to go http://matplotlib.1069221.n5.nabble.com/matplotlib-users-f3.html to reply the the mail. I think I must miss something? Chao -- *********************************************************************************** Chao YUE Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL) UMR 1572 CEA-CNRS-UVSQ Batiment 712 - Pe 119 91191 GIF Sur YVETTE Cedex Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16 ************************************************************************************ |
|
From: ChaoYue <cha...@gm...> - 2013-01-24 17:33:13
|
could you try l = ax.legend((p1,p2),['points','point_2'],scatterpoints=2) I think length-1 list label make the second point omitted. Chao -- View this message in context: http://matplotlib.1069221.n5.nabble.com/append-to-or-concatenate-PathCollection-objects-tp40302p40309.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
|
From: Pierre H. <pie...@cr...> - 2013-01-24 17:23:48
|
Hi,
I'm having an issue with the rendering of the € sign with pdf saved
figures while it looks fine on screen or on png saved figures.
Here is a minimal pylab example, and I've attached the two output files
figure()
plot()
title(u'Cost of X in €/MWh')
savefig('Cost in euros.png') # € sign renders fine
savefig('Cost in euros.pdf') # € sign is slightly vertically shifted
I made several tests with different strings. It happens that the
vertical shift seems to relate to the '/' symbol because '€' alone or
'€1' renders fine. Maybe something about kerning ?
I'm using version 1.1.1rc2 from Debian testing.
In my matplotlibrc, I have a customized line related to fonts:
font.sans-serif : DejaVu Sans, sans-serif
Does this influence the pdf generation in an intrusive way ?
I'm really not familiar with how PDF files are generated. I can only
report that Okular says that the pdf indeed contains the Deja Vu font
"fully integrated", in "Type 3". I guess this means something to some
people here but not me !
best,
Pierre
|
|
From: Benjamin R. <ben...@ou...> - 2013-01-24 15:37:06
|
On Thu, Jan 24, 2013 at 10:13 AM, Chao YUE <cha...@gm...> wrote: > Dear all, > > I upgrade my matplotlib from 1.1.1 to 1.2.0 using the command: > > sudo pip-python install --upgrade matplotlib > > it completes successfully. However I tried to > > import matplotlib.pyplot as plt, I get the error: > > /usr/lib64/python2.7/site-packages/matplotlib/backends/backend_gdk.py in > <module>() > 27 from matplotlib.mathtext import MathTextParser > 28 from matplotlib.transforms import Affine2D > ---> 29 from matplotlib.backends._backend_gdk import > pixbuf_get_pixels_array > 30 > 31 backend_version = "%d.%d.%d" % gtk.pygtk_version > > > in my ~/.matplotlib/matplotlibrc, I am using: > backend : GTKAgg > > So what backend should I choose? thanks for any help, > > Chao > > Did you have all of the gtk/gdk development packages installed? If the installer can't find them to compile _backend_gdk.so, then it wouldn't be made available in the install. As a work-around, you could always use TkAgg, as that is a pure-python backend. I hope that helps! Ben Root |
|
From: Chao Y. <cha...@gm...> - 2013-01-24 15:13:43
|
Dear all,
I upgrade my matplotlib from 1.1.1 to 1.2.0 using the command:
sudo pip-python install --upgrade matplotlib
it completes successfully. However I tried to
import matplotlib.pyplot as plt, I get the error:
/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_gdk.py in
<module>()
27 from matplotlib.mathtext import MathTextParser
28 from matplotlib.transforms import Affine2D
---> 29 from matplotlib.backends._backend_gdk import pixbuf_get_pixels_array
30
31 backend_version = "%d.%d.%d" % gtk.pygtk_version
in my ~/.matplotlib/matplotlibrc, I am using:
backend : GTKAgg
So what backend should I choose? thanks for any help,
Chao
--
***********************************************************************************
Chao YUE
Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
UMR 1572 CEA-CNRS-UVSQ
Batiment 712 - Pe 119
91191 GIF Sur YVETTE Cedex
Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16
************************************************************************************
|
|
From: Michael D. <md...@st...> - 2013-01-23 19:23:17
|
Does this pull request: https://github.com/matplotlib/matplotlib/pull/1697 fix your issue? I have no way of knowing without a test case... Mike On 01/22/2013 08:33 AM, Massimiliano Costacurta wrote: > Hello everyone, > > in my program I'm encountering an error when calling the function > axes.set_xticks (Matplotlib 1.2.0 on python 2.7-64 bit). It is really > difficult for me to build a test case, because my program is really > complex. Here is the error traceback: > > File "C:\Python27\Lib\site-packages\matplotlib\axes.py", line 2596, in > set_xticks > return self.xaxis.set_ticks(ticks, minor=minor) > File "C:\Python27\Lib\site-packages\matplotlib\axis.py", line 1489, in > set_ticks > self.set_view_interval(min(ticks), max(ticks)) > File "C:\Python27\Lib\site-packages\matplotlib\axis.py", line 1771, in > set_view_interval > max(vmin, vmax, Vmax)) > File "C:\Python27\Lib\site-packages\matplotlib\transforms.py", line > 932, in _set_intervalx > self.invalidate() > File "C:\Python27\Lib\site-packages\matplotlib\transforms.py", line > 131, in invalidate > return self._invalidate_internal(value, invalidating_node=self) > File "C:\Python27\Lib\site-packages\matplotlib\transforms.py", line > 155, in _invalidate_internal > invalidating_node=self) > File "C:\Python27\Lib\site-packages\matplotlib\transforms.py", line > 155, in _invalidate_internal > invalidating_node=self) > File "C:\Python27\Lib\site-packages\matplotlib\transforms.py", line > 155, in _invalidate_internal > invalidating_node=self) > File "C:\Python27\Lib\site-packages\matplotlib\transforms.py", line > 2141, in _invalidate_internal > invalidating_node=invalidating_node) > File "C:\Python27\Lib\site-packages\matplotlib\transforms.py", line > 155, in _invalidate_internal > invalidating_node=self) > File "C:\Python27\Lib\site-packages\matplotlib\transforms.py", line > 2141, in _invalidate_internal > invalidating_node=invalidating_node) > File "C:\Python27\Lib\site-packages\matplotlib\transforms.py", line > 153, in _invalidate_internal > for parent in self._parents.itervalues(): > File "C:\Python27\Lib\weakref.py", line 147, in itervalues > for wr in self.data.itervalues(): > RuntimeError: dictionary changed size during iteration > > I googled and found that this is a well known bug due to the use of > self.data.itervalues() in the for loop (i think the correct syntax > should be for wr in iter(self.data.items()). So I would like to point > out the bug (if it is) to the matplotlib guys, how can I do it? > In the meantime, how can I work around it without changing the source > code? > Thanks in advance! > > > ------------------------------------------------------------------------------ > Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, > MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current > with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft > MVPs and experts. ON SALE this month only -- learn more at: > http://p.sf.net/sfu/learnnow-d2d > > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
|
From: Jonathan S. <js...@cf...> - 2013-01-23 18:19:56
|
Sterling,
I have version 1.2.0. I read the legend guide. Which thing should be
possible? If you mean giving the points as a tuple, here's some simple
test code:
import matplotlib.pyplot as plt
import numpy as np
fig = plt.figure()
ax = fig.add_subplot(1,1,1)
p1 = ax.scatter([0.1],[0.5],c='r',marker='s')
p2 = ax.scatter([0.3],[0.2],c='b',marker='o')
l = ax.legend((p1,p2),['points'],scatterpoints=2)
plt.show()
I get a legend with only red squares. What I want is a legend line with
a red square and a blue circle. I can get points with different colors
if I do:
p1 = ax.scatter([0.1,0.3],[0.5,0.2],c=('r','b'),marker='s')
l = ax.legend(['points'],scatterpoints=2)
(though as far as I can tell, you can't have a sequence of marker
types).
Jon
On Wed, 2013-01-23 at 09:57 -0800, Sterling Smith wrote:
> Jon,
>
> What version of matplotlib do you have? According to
> http://matplotlib.org/users/legend_guide.html
> what you say should be possible in 1.2.0.
>
> -Sterling
>
> On Jan 23, 2013, at 9:35AM, Jonathan Slavin wrote:
>
> > Hi,
> >
> > I'm wondering if there is some straightforward way to combine two
> > PathCollection objects to create a new PathCollection object. My goal
> > is to include two points that use different axes (one twin'ed to the
> > other) into a single legend item (different point types, same label).
> > Each call to scatter creates a new PathCollection object. If I could
> > just combine two (or more) PathCollection objects -- either extending
> > them or concatenating or whatever -- then I could give that to legend
> > and it would work correctly. But it's not clear to me how I can do
> > that. I tried providing the two objects as a tuple to legend, but it
> > doesn't work (only point characteristics of one of them is used).
> >
> > Really, I think this should be easier -- both the combining of such
> > objects (which after all, are collections) and providing legend with
> > simple arguments to produce what you want. As far as I can tell I can't
> > just tell leged directly the symbol type(s) and colors of point(s) per
> > each label. Though in general the automatic method whereby you provide
> > the object to the legend is nice and easy, a more crude and direct way
> > would be a good option for special cases.
> >
> > Jon
> > --
> > ______________________________________________________________
> > Jonathan D. Slavin Harvard-Smithsonian CfA
> > js...@cf... 60 Garden Street, MS 83
> > phone: (617) 496-7981 Cambridge, MA 02138-1516
> > cell: (781) 363-0035 USA
> > ______________________________________________________________
> >
> >
> > ------------------------------------------------------------------------------
> > Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
> > MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
> > with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
> > MVPs and experts. ON SALE this month only -- learn more at:
> > http://p.sf.net/sfu/learnnow-d2d
> > _______________________________________________
> > Matplotlib-users mailing list
> > Mat...@li...
> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
--
______________________________________________________________
Jonathan D. Slavin Harvard-Smithsonian CfA
js...@cf... 60 Garden Street, MS 83
phone: (617) 496-7981 Cambridge, MA 02138-1516
cell: (781) 363-0035 USA
______________________________________________________________
|
|
From: Paul H. <pmh...@gm...> - 2013-01-23 18:19:23
|
On Mon, Jan 21, 2013 at 4:28 AM, Kelson Zawack <kb...@co...> wrote:
> a heat map and want to label each row. I thus need the font
> size of the text to scale with the number of rows in the heat map. Is
>
Assuming you start out with this:
import matplotlib.pyplot as plt
fig, ax1 = plt.subplots()
You can then do this:
figsize = fig.get_size_inches()
ax_pos = ax1.get_position().get_points()
The variable figsize is now a array of the figure's width and height. And
ax_pos is an array with the first row being the x-y location of the lower
left corner of the axes on the figure in figure fraction coordinates. The
second row is the width and height of the axes, again expressed as a
fraction of the total figure dimensions.
Hope that helps,
-paul
|