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: Joe K. <jof...@gm...> - 2015-06-05 16:15:20
|
> > Hopefully I will have some time today to play around with the D option. I > want to see if I can shift the curve a bit to include more yellows and > orange so that it can have a mix of cool and warm colors. > > > I was thinking the same thing earlier. Here's my attempt: Note to Ben, et al, you got an e-mail from me earlier that bounced to the list (too big). This is a less muted version of that colormap. |
From: Juan Wu <wuj...@gm...> - 2015-06-05 16:15:03
|
Hi, Experts, My colleagues and I have a question, how we can make a plot via python like below. According to a guy's original paper, "Each panel shows the normalized histograms of the observed data (bar plots) and the model prediction (black lines) ". I believe that people can make it with Matplotlib. Any code suggestion (with simple example data) would be much appreciated. (I am more comfortable with Matlab, but now the python code is preferred). J [image: Inline image 3] |
From: Benjamin R. <ben...@ou...> - 2015-06-05 15:36:42
|
It is funny that you mention that you prefer the warmer colors over the cooler colors. There has been some back-n-forth about which is better. I personally have found myself adverse to using just cool or just warm colors, preferring a mix of cool and warm colors. Perhaps it is my background in meteorology and viewing temperature maps? Another place where a mix of cool and warm colors are useful is for severity indications such as radar maps. It is no accident that radar maps are colored greens and blues for weak precipitation, then yellow for heavier, and then reds for heaviest (possibly severe) precipitation -- it came from the old FAA color guides. While we all know that that colormap is fundamentally flawed, there was a rationale behind it. Hopefully I will have some time today to play around with the D option. I want to see if I can shift the curve a bit to include more yellows and orange so that it can have a mix of cool and warm colors. Ben Root On Fri, Jun 5, 2015 at 11:21 AM, Philipp A. <fly...@we...> wrote: > I vote for A and B. Only B if i get just one vote. > > C is too washed out and i like the warm colors more than the cold ones in > D. > > It’s funny that this comes up while I’m handling colormaps in my own work > at the moment. > > Neal Becker <ndb...@gm...> schrieb am Fr., 5. Juni 2015 um > 12:58 Uhr: > >> I vote for D, although I like matlab's new default even better >> >> >> >> ------------------------------------------------------------------------------ >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> > > > ------------------------------------------------------------------------------ > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > |
From: Philipp A. <fly...@we...> - 2015-06-05 15:21:54
|
I vote for A and B. Only B if i get just one vote. C is too washed out and i like the warm colors more than the cold ones in D. It’s funny that this comes up while I’m handling colormaps in my own work at the moment. Neal Becker <ndb...@gm...> schrieb am Fr., 5. Juni 2015 um 12:58 Uhr: > I vote for D, although I like matlab's new default even better > > > > ------------------------------------------------------------------------------ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
From: Thomas S. <spr...@hd...> - 2015-06-05 12:42:05
|
I opt for B, and adding the matlab-default as secondary. cheers THomas Thomas Sprinzing Dipl.-Ing. (FH) Labor Tiefdruck Studiengang Druck- und Medientechnologie Hochschule der Medien University of Applied Sciences Nobelstr. 10 70569 Stuttgart Telefon: +49 711 8923 2196 www.hdm-stuttgart.de/dt Am 05.06.2015 um 13:20 schrieb Jan Heczko <jan...@gm...>: > I'd choose D. > A and B are too dark. Also, A-C seem to hide some detail in the simulation of color blindness. > > On 4 June 2015 at 22:42, Eric Firing <ef...@ha...> wrote: > I am forwarding a message from Nathaniel Smith which is the start of a > long thread on matplotlib-devel > http://news.gmane.org/gmane.comp.python.matplotlib.devel > related to changes that are in the works for matplotlib, and that are > therefore of interest to matplotlib users. Specifically, we will be > updating the default color cycle for line plots, and the default > colormap for image-type plots, including contourf and pcolormesh. The > most important part of Nathaniel's message is the link: > > https://bids.github.io/colormap/ > > which has been updated since his first message below. > > Note that we are looking for a new *default* colormap--the one that will > be used if you have not specified an alternative in your matplotlibrc > file, your function keyword arguments, or anywhere else. It does not in > any way limit your ability to specify a colormap that you prefer for a > particular application, or as your own default. Rather, it should be a > good all-around choice, that works reasonably well in a variety of > applications, and that most people will find *comfortable* as well as > functional. It will become part of matplotlib's "look"; it should > attract rather than repel prospective and new users. We have some > consensus about some of the other criteria, and these are coded into the > tool that Nathaniel and Stéfan have developed for generating colormaps. > So far, 4 alternatives generated with this tool have been proposed at > the link above; more might be added. > > Eric > > -------- Forwarded Message -------- > Subject: [matplotlib-devel] RFC: candidates for a new default colormap > Date: Tue, 2 Jun 2015 18:46:21 -0700 > From: Nathaniel Smith <nj...@po...> > To: mat...@li... > <mat...@li...> > > Hi all, > > As was hinted at in a previous thread, Stéfan van der Walt and I have > been using some Fancy Color Technology to attempt to design a new > colormap intended to become matplotlib's new default. (Down with jet!) > > Unfortunately, while our Fancy Color Technology includes a > computational model of perceptual distance, it does not include a > computational model of aesthetics. So this is where you come in. > > We've put up three reasonable candidates at: > https://bids.github.io/colormap/ > (along with some well-known colormaps for comparison), and we'd like > your feedback. > > They are all optimal on all of the objective criteria we know how to > measure. What we need judgements on is which one you like best, both > aesthetically and as a way of visualizing data. (There are some sample > plots to look at there, plus you can download them and play with them > on your own data if you want.) > > We especially value input from anyone with anomalous color vision. > There are some simulations there, but computational models are > inherently limited here. (It's difficult to ask someone with > colorblindness "does this look to you, the same way this other picture > looks to me?") > > -n > > -- > Nathaniel J. Smith -- http://vorpus.org > > ------------------------------------------------------------------------------ > _______________________________________________ > Matplotlib-devel mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-devel > > > > ------------------------------------------------------------------------------ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > ------------------------------------------------------------------------------ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
From: Jan H. <jan...@gm...> - 2015-06-05 11:20:50
|
I'd choose D. A and B are too dark. Also, A-C seem to hide some detail in the simulation of color blindness. On 4 June 2015 at 22:42, Eric Firing <ef...@ha...> wrote: > I am forwarding a message from Nathaniel Smith which is the start of a > long thread on matplotlib-devel > http://news.gmane.org/gmane.comp.python.matplotlib.devel > related to changes that are in the works for matplotlib, and that are > therefore of interest to matplotlib users. Specifically, we will be > updating the default color cycle for line plots, and the default > colormap for image-type plots, including contourf and pcolormesh. The > most important part of Nathaniel's message is the link: > > https://bids.github.io/colormap/ > > which has been updated since his first message below. > > Note that we are looking for a new *default* colormap--the one that will > be used if you have not specified an alternative in your matplotlibrc > file, your function keyword arguments, or anywhere else. It does not in > any way limit your ability to specify a colormap that you prefer for a > particular application, or as your own default. Rather, it should be a > good all-around choice, that works reasonably well in a variety of > applications, and that most people will find *comfortable* as well as > functional. It will become part of matplotlib's "look"; it should > attract rather than repel prospective and new users. We have some > consensus about some of the other criteria, and these are coded into the > tool that Nathaniel and Stéfan have developed for generating colormaps. > So far, 4 alternatives generated with this tool have been proposed at > the link above; more might be added. > > Eric > > -------- Forwarded Message -------- > Subject: [matplotlib-devel] RFC: candidates for a new default colormap > Date: Tue, 2 Jun 2015 18:46:21 -0700 > From: Nathaniel Smith <nj...@po...> > To: mat...@li... > <mat...@li...> > > Hi all, > > As was hinted at in a previous thread, Stéfan van der Walt and I have > been using some Fancy Color Technology to attempt to design a new > colormap intended to become matplotlib's new default. (Down with jet!) > > Unfortunately, while our Fancy Color Technology includes a > computational model of perceptual distance, it does not include a > computational model of aesthetics. So this is where you come in. > > We've put up three reasonable candidates at: > https://bids.github.io/colormap/ > (along with some well-known colormaps for comparison), and we'd like > your feedback. > > They are all optimal on all of the objective criteria we know how to > measure. What we need judgements on is which one you like best, both > aesthetically and as a way of visualizing data. (There are some sample > plots to look at there, plus you can download them and play with them > on your own data if you want.) > > We especially value input from anyone with anomalous color vision. > There are some simulations there, but computational models are > inherently limited here. (It's difficult to ask someone with > colorblindness "does this look to you, the same way this other picture > looks to me?") > > -n > > -- > Nathaniel J. Smith -- http://vorpus.org > > > ------------------------------------------------------------------------------ > _______________________________________________ > Matplotlib-devel mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-devel > > > > > ------------------------------------------------------------------------------ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
From: Neal B. <ndb...@gm...> - 2015-06-05 10:52:19
|
I vote for D, although I like matlab's new default even better |
From: Joy m. m. <joy...@gm...> - 2015-06-05 02:03:37
|
If we have to reply on this thread, I would choose Option C. I don't like A,B because of the strong black at the edges, which sometimes saturate plots whose values vary a lot. I prefer C over D because of a personal preference towards darker colours. Joy On Fri, Jun 5, 2015 at 2:12 AM, Eric Firing <ef...@ha...> wrote: > I am forwarding a message from Nathaniel Smith which is the start of a > long thread on matplotlib-devel > http://news.gmane.org/gmane.comp.python.matplotlib.devel > related to changes that are in the works for matplotlib, and that are > therefore of interest to matplotlib users. Specifically, we will be > updating the default color cycle for line plots, and the default > colormap for image-type plots, including contourf and pcolormesh. The > most important part of Nathaniel's message is the link: > > https://bids.github.io/colormap/ > > which has been updated since his first message below. > > Note that we are looking for a new *default* colormap--the one that will > be used if you have not specified an alternative in your matplotlibrc > file, your function keyword arguments, or anywhere else. It does not in > any way limit your ability to specify a colormap that you prefer for a > particular application, or as your own default. Rather, it should be a > good all-around choice, that works reasonably well in a variety of > applications, and that most people will find *comfortable* as well as > functional. It will become part of matplotlib's "look"; it should > attract rather than repel prospective and new users. We have some > consensus about some of the other criteria, and these are coded into the > tool that Nathaniel and Stéfan have developed for generating colormaps. > So far, 4 alternatives generated with this tool have been proposed at > the link above; more might be added. > > Eric > > -------- Forwarded Message -------- > Subject: [matplotlib-devel] RFC: candidates for a new default colormap > Date: Tue, 2 Jun 2015 18:46:21 -0700 > From: Nathaniel Smith <nj...@po...> > To: mat...@li... > <mat...@li...> > > Hi all, > > As was hinted at in a previous thread, Stéfan van der Walt and I have > been using some Fancy Color Technology to attempt to design a new > colormap intended to become matplotlib's new default. (Down with jet!) > > Unfortunately, while our Fancy Color Technology includes a > computational model of perceptual distance, it does not include a > computational model of aesthetics. So this is where you come in. > > We've put up three reasonable candidates at: > https://bids.github.io/colormap/ > (along with some well-known colormaps for comparison), and we'd like > your feedback. > > They are all optimal on all of the objective criteria we know how to > measure. What we need judgements on is which one you like best, both > aesthetically and as a way of visualizing data. (There are some sample > plots to look at there, plus you can download them and play with them > on your own data if you want.) > > We especially value input from anyone with anomalous color vision. > There are some simulations there, but computational models are > inherently limited here. (It's difficult to ask someone with > colorblindness "does this look to you, the same way this other picture > looks to me?") > > -n > > -- > Nathaniel J. Smith -- http://vorpus.org > > > ------------------------------------------------------------------------------ > _______________________________________________ > Matplotlib-devel mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-devel > > > > > ------------------------------------------------------------------------------ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > -- The best ruler, when he finishes his tasks and completes his affairs, the people say “It all happened naturally” - Te Tao Ch'ing |
From: Eric F. <ef...@ha...> - 2015-06-04 20:42:56
|
I am forwarding a message from Nathaniel Smith which is the start of a long thread on matplotlib-devel http://news.gmane.org/gmane.comp.python.matplotlib.devel related to changes that are in the works for matplotlib, and that are therefore of interest to matplotlib users. Specifically, we will be updating the default color cycle for line plots, and the default colormap for image-type plots, including contourf and pcolormesh. The most important part of Nathaniel's message is the link: https://bids.github.io/colormap/ which has been updated since his first message below. Note that we are looking for a new *default* colormap--the one that will be used if you have not specified an alternative in your matplotlibrc file, your function keyword arguments, or anywhere else. It does not in any way limit your ability to specify a colormap that you prefer for a particular application, or as your own default. Rather, it should be a good all-around choice, that works reasonably well in a variety of applications, and that most people will find *comfortable* as well as functional. It will become part of matplotlib's "look"; it should attract rather than repel prospective and new users. We have some consensus about some of the other criteria, and these are coded into the tool that Nathaniel and Stéfan have developed for generating colormaps. So far, 4 alternatives generated with this tool have been proposed at the link above; more might be added. Eric -------- Forwarded Message -------- Subject: [matplotlib-devel] RFC: candidates for a new default colormap Date: Tue, 2 Jun 2015 18:46:21 -0700 From: Nathaniel Smith <nj...@po...> To: mat...@li... <mat...@li...> Hi all, As was hinted at in a previous thread, Stéfan van der Walt and I have been using some Fancy Color Technology to attempt to design a new colormap intended to become matplotlib's new default. (Down with jet!) Unfortunately, while our Fancy Color Technology includes a computational model of perceptual distance, it does not include a computational model of aesthetics. So this is where you come in. We've put up three reasonable candidates at: https://bids.github.io/colormap/ (along with some well-known colormaps for comparison), and we'd like your feedback. They are all optimal on all of the objective criteria we know how to measure. What we need judgements on is which one you like best, both aesthetically and as a way of visualizing data. (There are some sample plots to look at there, plus you can download them and play with them on your own data if you want.) We especially value input from anyone with anomalous color vision. There are some simulations there, but computational models are inherently limited here. (It's difficult to ask someone with colorblindness "does this look to you, the same way this other picture looks to me?") -n -- Nathaniel J. Smith -- http://vorpus.org ------------------------------------------------------------------------------ _______________________________________________ Matplotlib-devel mailing list Mat...@li... https://lists.sourceforge.net/lists/listinfo/matplotlib-devel |
From: Alejandro U. <ale...@gm...> - 2015-06-03 20:19:53
|
Hi, I am trying to get a live scrolling graph built from data send by two arduino sensors. Although live data is being shown in the graph I am not able to get the x axis scrolling. Actually, after reaching the point established by the counter (in this case cnt>10), the plotting stops. The arduino and Python codes I am working with are included below. I would very much appreciate if you can help me getting the scrolling graph working. ARDUINO CODE #include "Wire.h" // imports the wire library for talking over I2C #include "Adafruit_BMP085.h" // import the Pressure Sensor Library Adafruit_BMP085 mySensor; // create sensor object called mySensor float tempC; // Variable for holding temp in C float tempF; // Variable for holding temp in F float pressure; //Variable for holding pressure reading void setup(){ Serial.begin(115200); //turn on serial monitor mySensor.begin(); //initialize mySensor } void loop() { tempC = mySensor.readTemperature(); // Be sure to declare your variables tempF = tempC*1.8 + 32.; // Convert degrees C to F pressure=mySensor.readPressure(); //Read Pressure Serial.print(tempF); Serial.print(" , "); Serial.println(pressure); delay(250); //Pause between readings. } PYTHON CODE import serial # import Serial Library import numpy # Import numpy import matplotlib.pyplot as plt #import matplotlib library from drawnow import * tempF= [] pressure=[] arduinoData = serial.Serial('com6', 115200) #Creating our serial object named arduinoData plt.ion() #Tell matplotlib you want interactive mode to plot live data cnt=0 def makeFig(): #Create a function that makes our desired plot plt.ylim(0,90) #Set y min and max values plt.title('My Live Streaming Sensor Data') #Plot the title plt.grid(True) #Turn the grid on plt.ylabel('Temp F') #Set ylabels plt.plot(tempF, 'ro-', label='Degrees F') #plot the temperature plt.legend(loc='upper left') #plot the legend plt2=plt.twinx() #Create a second y axis plt.ylim(0,90) #Set limits of second y axis- adjust to readings you are getting plt2.plot(pressure, 'b^-', label='Pressure (Pa)') #plot pressure data plt2.set_ylabel('Pressrue (Pa)') #label second y axis plt2.ticklabel_format(useOffset=False) #Force matplotlib to NOT autoscale y axis plt2.legend(loc='upper right') #plot the legend while True: # While loop that loops forever while (arduinoData.inWaiting()==0): #Wait here until there is data pass #do nothing arduinoString = arduinoData.readline() #read the line of text from the serial port dataArray = arduinoString.split(',') #Split it into an array called dataArray temp = float( dataArray[0]) #Convert first element to floating number and put in temp P = float( dataArray[1]) #Convert second element to floating number and put in P tempF.append(temp) #Build our tempF array by appending temp readings pressure.append(P) #Building our pressure array by appending P readings drawnow(makeFig) #Call drawnow to update our live graph plt.pause(.000001) #Pause Briefly. Important to keep drawnow from crashing cnt=cnt+1 if(cnt>10): #If you have 50 or more points, delete the first one from the array tempF.pop(0) #This allows us to just see the last 50 data points pressure.pop(0) |
From: Yuxiang W. <yw...@vi...> - 2015-06-03 20:00:31
|
Hi Juan, FYI - you forgot to reply to the mailing list in your previous email... As for the problem, as Eric mentioned, it seems to be a problem with your plot_posterior_nodes function. That one is out of the matplotlib library, and I guess it belongs to the HDDM package. You might want to ask people in their mailing list for more help, Shawn On Wed, Jun 3, 2015 at 2:10 PM, Juan Wu <wuj...@gm...> wrote: > Shawn, > > Thanks so much for your prompt reply. This is my code, but it calls other > package (i.e., HDDM). > > v_Neutral, v_Win, v_Loss = m_within_subj.nodes_db.ix[["v_Intercept", > "v_C(Value_Cond, > Treatment('Neutral'))[T.Win]", > "v_C(Value_Cond, > Treatment('Neutral'))[T.Loss]"], 'node'] > hddm.analyze.plot_posterior_nodes([v_Neutral, v_Win, v_Loss]) > plt.xlabel('drift-rate') > plt.ylabel('Posterior probability') > plt.title('Group mean posteriors of within-subject drift-rate effects.') > plt.savefig('E4_within_subject_design.pdf') > > I also tried this, but it also did not work. > > v_Neutral, v_Win, v_Loss = m_within_subj.nodes_db.ix[["v_Intercept", > "v_C(Value_Cond, > Treatment('Neutral'))[T.Win]", > "v_C(Value_Cond, > Treatment('Neutral'))[T.Loss]"], 'node'] > #hddm.analyze.plot_posterior_nodes([v_Neutral, v_Win, v_Loss]) > hddm.analyze.plot_posterior_nodes([float(v_Neutral), float(v_Win), > float(v_Loss)]) > plt.xlabel('drift-rate') > plt.ylabel('Posterior probability') > plt.title('Group mean posteriors of within-subject drift-rate effects.') > plt.savefig('E4_within_subject_design.pdf') > > > > On Wed, Jun 3, 2015 at 2:06 PM, Yuxiang Wang <yw...@vi...> wrote: > >> Hi Juan, >> >> Could you post a minimal code to reproduce your issue? >> >> Shawn >> >> On Wed, Jun 3, 2015 at 2:03 PM, Juan Wu <wuj...@gm...> wrote: >> >>> Hi, List experts, >>> >>> Any one can help for this error solution? I googled but did not find >>> this report. >>> >>> Thanks in adance... >>> >>> <matplotlib.figure.Figure at 0x1afe8f50> >>> Traceback (most recent call last): >>> >>> File "<ipython-input-38-7909dff7bc28>", line 5, in <module> >>> hddm.analyze.plot_posterior_nodes([float(v_Neutral), float(v_Win), >>> float(v_Loss)]) >>> >>> File "C:\Anaconda\lib\site-packages\kabuki\analyze.py", line 34, in >>> plot_posterior_nodes >>> lb = min([min(node.trace()[:]) for node in nodes]) >>> >>> AttributeError: 'float' object has no attribute 'trace' >>> >>> >>> ------------------------------------------------------------------------------ >>> >>> _______________________________________________ >>> Matplotlib-users mailing list >>> Mat...@li... >>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >>> >>> >> >> >> -- >> Yuxiang "Shawn" Wang >> Gerling Research Lab >> University of Virginia >> yw...@vi... >> +1 (434) 284-0836 >> https://sites.google.com/a/virginia.edu/yw5aj/ >> > > -- Yuxiang "Shawn" Wang Gerling Research Lab University of Virginia yw...@vi... +1 (434) 284-0836 https://sites.google.com/a/virginia.edu/yw5aj/ |
From: Eric F. <ef...@ha...> - 2015-06-03 18:12:45
|
On 2015/06/03 8:03 AM, Juan Wu wrote: > Hi, List experts, > > Any one can help for this error solution? I googled but did not find > this report. > > Thanks in adance... > > <matplotlib.figure.Figure at 0x1afe8f50> > Traceback (most recent call last): > > File "<ipython-input-38-7909dff7bc28>", line 5, in <module> > hddm.analyze.plot_posterior_nodes([float(v_Neutral), float(v_Win), > float(v_Loss)]) > > File "C:\Anaconda\lib\site-packages\kabuki\analyze.py", line 34, in > plot_posterior_nodes > lb = min([min(node.trace()[:]) for node in nodes]) > > AttributeError: 'float' object has no attribute 'trace' This error is not coming from matplotlib at all. plot_posterior_nodes is not our function. Eric |
From: Yuxiang W. <yw...@vi...> - 2015-06-03 18:06:45
|
Hi Juan, Could you post a minimal code to reproduce your issue? Shawn On Wed, Jun 3, 2015 at 2:03 PM, Juan Wu <wuj...@gm...> wrote: > Hi, List experts, > > Any one can help for this error solution? I googled but did not find this > report. > > Thanks in adance... > > <matplotlib.figure.Figure at 0x1afe8f50> > Traceback (most recent call last): > > File "<ipython-input-38-7909dff7bc28>", line 5, in <module> > hddm.analyze.plot_posterior_nodes([float(v_Neutral), float(v_Win), > float(v_Loss)]) > > File "C:\Anaconda\lib\site-packages\kabuki\analyze.py", line 34, in > plot_posterior_nodes > lb = min([min(node.trace()[:]) for node in nodes]) > > AttributeError: 'float' object has no attribute 'trace' > > > ------------------------------------------------------------------------------ > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > -- Yuxiang "Shawn" Wang Gerling Research Lab University of Virginia yw...@vi... +1 (434) 284-0836 https://sites.google.com/a/virginia.edu/yw5aj/ |
From: Juan Wu <wuj...@gm...> - 2015-06-03 18:03:57
|
Hi, List experts, Any one can help for this error solution? I googled but did not find this report. Thanks in adance... <matplotlib.figure.Figure at 0x1afe8f50> Traceback (most recent call last): File "<ipython-input-38-7909dff7bc28>", line 5, in <module> hddm.analyze.plot_posterior_nodes([float(v_Neutral), float(v_Win), float(v_Loss)]) File "C:\Anaconda\lib\site-packages\kabuki\analyze.py", line 34, in plot_posterior_nodes lb = min([min(node.trace()[:]) for node in nodes]) AttributeError: 'float' object has no attribute 'trace' |
From: Benjamin R. <ben...@ou...> - 2015-06-03 16:43:23
|
The plot will autoscale base on the data that has been plotted to it. In your code, you are repeatedly calling plot(), albeit with a "scrolled" version of the data, but all of the previous calls to plot() are still visible. Also, no x-coordinate information is provided to the calls to plot(), so each new call to plot() only overlays on top of the previous calls. I also see that you are using the interactive mode. This isn't really necessary. I would suggest reading through some of the animation examples to see how to automatically update your plot: http://matplotlib.org/examples/animation/index.html . I would particularly point out the "animate_decay" example. While it isn't a scrolling example, you can see how to update an existing plot with new data from a generator. It would then just be a matter of updating the x-limits for each update. I hope that helps! Ben Root On Wed, Jun 3, 2015 at 12:17 PM, Alejandro Ureta < ale...@gm...> wrote: > Hi, I am trying to get a live scrolling graph built from data send by two > arduino sensors. Although live data is being shown in the graph I am not > able to get it scrolling. The arduino and Python codes I am working with > are included below. I would very much appreciate if you can help me getting > the scrolling graph working. > > > > PYTHON CODE: > > import serial # import Serial Library > > import numpy # Import numpy > > import matplotlib.pyplot as plt #import matplotlib library > > from drawnow import * > > > > tempF= [] > > pressure= [] > > > > arduinoData = serial.Serial('com6', 115200) #Creating our serial object > named arduinoData > > plt.ion() #Tell matplotlib you want interactive mode to plot live data > > cnt=0 > > > > def makeFig(): #Create a function that makes our desired plot > > plt.ylim(0,500) #Set y min and max > values > > plt.title('Frequency vs Time') #Plot the title > > plt.grid(True) #Turn the grid on > > plt.ylabel('Frequency (pulses/sec)') #Set > ylabels > > plt.plot(tempF, 'ro-', label='pulses/sec') #plot the temperature > > plt.legend(loc='upper left') #plot the legend > > > > > > plt2=plt.twinx() #Create a second y axis > > plt.ylim(0,500) #Set limits of second y > axis- adjust to readings you are getting > > plt2.plot(pressure, 'b^-', label='Pressure (Pa)') #plot pressure data > > plt2.set_ylabel('Pressrue (Pa)') #label second y > axis > > plt2.ticklabel_format(useOffset=False) #Force matplotlib to > NOT autoscale y axis > > plt2.legend(loc='upper right') #plot the legend > > > > > > while True: # While loop that loops forever > > while (arduinoData.inWaiting()==0): #Wait here until there is data > > pass #do nothing > > arduinoString = arduinoData.readline() #read the line of text from the > serial port > > dataArray = arduinoString.split(',') #Split it into an array called > dataArray > > temp = float(dataArray[0]) #Convert first element to > floating number and put in temp > > pres = float(dataArray[1]) #Convert second element to > floating number and put in P > > tempF.append(temp) #Build our tempF array by > appending temp readings > > pressure.append(pres) #Building our pressure > array by appending P readings > > drawnow(makeFig) #Call drawnow to update our > live graph > > plt.pause(.000001) #Pause Briefly. Important to > keep drawnow from crashing > > cnt=cnt+1 > > if(cnt>10): #If you have 50 or more points, > delete the first one from the array > > tempF.pop(0) #This allows us to just see the > last 50 data points > > pressure.pop(0) > > > > > > > > > > > > > > > > ARDUINO CODE: > > > > > > #include "Wire.h" // imports the wire library for talking over I2C > > #include "Adafruit_BMP085.h" // import the Pressure Sensor Library > > Adafruit_BMP085 mySensor; // create sensor object called mySensor > > > > float tempC; // Variable for holding temp in C > > float tempF; // Variable for holding temp in F > > float pressure; //Variable for holding pressure reading > > > > void setup(){ > > Serial.begin(115200); //turn on serial monitor > > mySensor.begin(); //initialize mySensor > > } > > > > void loop() { > > tempC = mySensor.readTemperature(); // Be sure to declare your variables > > tempF = tempC*1.8 + 32.; // Convert degrees C to F > > pressure=mySensor.readPressure(); //Read Pressure > > > > > > Serial.print(tempF); > > Serial.print(" , "); > > Serial.println(pressure); > > delay(250); //Pause between readings. > > } > > > > > > > > > > > > > > > > > > > > > > > > > > > ------------------------------------------------------------------------------ > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > |
From: Alejandro U. <ale...@gm...> - 2015-06-03 16:17:59
|
Hi, I am trying to get a live scrolling graph built from data send by two arduino sensors. Although live data is being shown in the graph I am not able to get it scrolling. The arduino and Python codes I am working with are included below. I would very much appreciate if you can help me getting the scrolling graph working. PYTHON CODE: import serial # import Serial Library import numpy # Import numpy import matplotlib.pyplot as plt #import matplotlib library from drawnow import * tempF= [] pressure= [] arduinoData = serial.Serial('com6', 115200) #Creating our serial object named arduinoData plt.ion() #Tell matplotlib you want interactive mode to plot live data cnt=0 def makeFig(): #Create a function that makes our desired plot plt.ylim(0,500) #Set y min and max values plt.title('Frequency vs Time') #Plot the title plt.grid(True) #Turn the grid on plt.ylabel('Frequency (pulses/sec)') #Set ylabels plt.plot(tempF, 'ro-', label='pulses/sec') #plot the temperature plt.legend(loc='upper left') #plot the legend plt2=plt.twinx() #Create a second y axis plt.ylim(0,500) #Set limits of second y axis- adjust to readings you are getting plt2.plot(pressure, 'b^-', label='Pressure (Pa)') #plot pressure data plt2.set_ylabel('Pressrue (Pa)') #label second y axis plt2.ticklabel_format(useOffset=False) #Force matplotlib to NOT autoscale y axis plt2.legend(loc='upper right') #plot the legend while True: # While loop that loops forever while (arduinoData.inWaiting()==0): #Wait here until there is data pass #do nothing arduinoString = arduinoData.readline() #read the line of text from the serial port dataArray = arduinoString.split(',') #Split it into an array called dataArray temp = float(dataArray[0]) #Convert first element to floating number and put in temp pres = float(dataArray[1]) #Convert second element to floating number and put in P tempF.append(temp) #Build our tempF array by appending temp readings pressure.append(pres) #Building our pressure array by appending P readings drawnow(makeFig) #Call drawnow to update our live graph plt.pause(.000001) #Pause Briefly. Important to keep drawnow from crashing cnt=cnt+1 if(cnt>10): #If you have 50 or more points, delete the first one from the array tempF.pop(0) #This allows us to just see the last 50 data points pressure.pop(0) ARDUINO CODE: #include "Wire.h" // imports the wire library for talking over I2C #include "Adafruit_BMP085.h" // import the Pressure Sensor Library Adafruit_BMP085 mySensor; // create sensor object called mySensor float tempC; // Variable for holding temp in C float tempF; // Variable for holding temp in F float pressure; //Variable for holding pressure reading void setup(){ Serial.begin(115200); //turn on serial monitor mySensor.begin(); //initialize mySensor } void loop() { tempC = mySensor.readTemperature(); // Be sure to declare your variables tempF = tempC*1.8 + 32.; // Convert degrees C to F pressure=mySensor.readPressure(); //Read Pressure Serial.print(tempF); Serial.print(" , "); Serial.println(pressure); delay(250); //Pause between readings. } |
From: Youngung J. <you...@gm...> - 2015-06-03 14:54:08
|
I think the problem is associated with the way np.arange is used. "np.arange(0,10,20)" would return array[0] If you still would like to manually configure the tick positions the way you seemed to want, you can use "np.linspace". Below worked for me. ---- import matplotlib.pyplot as plt import numpy as np fig = plt.figure() ax = fig.add_subplot(1,1,1) x = np.linspace(0,10,50) y = np.sin(x) ax.plot(x,y) ax.grid('on') leg = plt.legend(['legend 1']) plt.title('Sample title') ax.set_ylabel('Sample ylabel') ax.set_xlabel('Sample xlabel') ax.set_xticks(np.linspace(0, 10, 11)) ax.set_yticks(np.linspace(-1,1,11)) ax.minorticks_on() plt.show() * Youngung Jeong* On Wed, Jun 3, 2015 at 9:27 AM, <st...@th...> wrote: > Hm, I tried both suggestions, and still no grid (removed PDF for > simplicity): > > import matplotlib.pyplot as plt > import numpy as np > > fig = plt.figure() > ax = fig.add_subplot(1,1,1) > > x = np.linspace(0,10,50) > y = np.sin(x) > > plt.clf() > > plt.clf() > plt.plot(x,y) > leg = plt.legend(['legend 1']) > plt.title('Sample title') > ax.set_ylabel('Sample ylabel') > ax.set_xlabel('Sample xlabel') > > ax.set_xticks(np.arange(0, 10, 20)) > ax.set_xticks(np.arange(0, 10, 5), minor=True) > ax.set_yticks(np.arange(-1,1,20)) > ax.set_yticks(np.arange(-1,1,20), minor=True) > > ax.minorticks_on() > ax.grid('on') > plt.show() > > > > > And if you meant 'grid', I guess > > > > ax.grid('on') > > > > should be added. > > > > * Youngung Jeong, ì •ì˜ ì›…* > > > > On Mon, Jun 1, 2015 at 4:38 PM, Sterling Smith <sm...@fu...> > > wrote: > > > >> Stephen, > >> > >> In your script, you give > >> ax.minorticks_on > >> but you need to call that function for anything to occur > >> ax.minorticks_on() > >> > >> > >> Also, did you see > >> http://matplotlib.org/examples/pylab_examples/axes_props.html > >> in case your original question was not answered. > >> > >> -Sterling > >> > >> On Jun 1, 2015, at 1:24PM, st...@th... wrote: > >> > >> > I only see that you added "plt.show()", but neither the grid or the > >> axis > >> > labels are showing up. > >> > > >> >> Here is what I see with a couple of things modified ? > >> >> did you expect something else ? > >> >> > >> >> from matplotlib.backends.backend_pdf import PdfPages > >> >> import matplotlib.pyplot as plt > >> >> import numpy as np > >> >> > >> >> fig = plt.figure() > >> >> ax = fig.add_subplot(1,1,1) > >> >> > >> >> x = np.linspace(0,10,50) > >> >> y = np.sin(x) > >> >> > >> >> with PdfPages('grid_test.pdf') as pdf: > >> >> plt.clf() > >> >> > >> >> plt.clf() > >> >> plt.plot(x,y) > >> >> leg = plt.legend(['legend 1']) > >> >> plt.title('Sample title') > >> >> ax.set_ylabel('Sample ylabel') > >> >> ax.set_xlabel('Sample xlabel') > >> >> > >> >> ax.set_xticks(np.arange(0, 10, 20)) > >> >> ax.set_xticks(np.arange(0, 10, 5), minor=True) > >> >> ax.set_yticks(np.arange(-1,1,20)) > >> >> ax.set_yticks(np.arange(-1,1,20), minor=True) > >> >> > >> >> ax.minorticks_on > >> >> plt.show() > >> >> > >> >> pdf.savefig() > >> >> > >> >> > >> >> [cid:8C8...@or...] > >> >> > >> >> > >> >> > >> >> On Jun 1, 2015, at 2:49 PM, > >> >> <st...@th...<mailto:st...@th...>> > >> >> wrote: > >> >> > >> >> I am having an issue with the grid not appearing that I cannot figure > >> out. > >> >> Can anyone help? Thanks. --StephenB > >> >> > >> >> from matplotlib.backends.backend_pdf import PdfPages > >> >> import matplotlib.pyplot as plt > >> >> import numpy as np > >> >> > >> >> fig = plt.figure() > >> >> ax = fig.add_subplot(1,1,1) > >> >> > >> >> x = np.linspace(0,10,50) > >> >> y = np.sin(x) > >> >> > >> >> with PdfPages('grid_test.pdf') as pdf: > >> >> plt.clf() > >> >> > >> >> plt.clf() > >> >> plt.plot(x,y) > >> >> leg = plt.legend(['legend 1']) > >> >> plt.title('Sample title') > >> >> ax.set_ylabel('Sample ylabel') > >> >> ax.set_xlabel('Sample xlabel') > >> >> > >> >> ax.set_xticks(np.arange(0, 10, 20)) > >> >> ax.set_xticks(np.arange(0, 10, 5), minor=True) > >> >> ax.set_yticks(np.arange(-1,1,20)) > >> >> ax.set_yticks(np.arange(-1,1,20), minor=True) > >> >> > >> >> ax.minorticks_on > >> >> > >> >> pdf.savefig() > >> >> > >> >> > >> >> > >> > ------------------------------------------------------------------------------ > >> >> _______________________________________________ > >> >> Matplotlib-users mailing list > >> >> Mat...@li...<mailto: > >> Mat...@li...> > >> >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users > >> >> > >> >> > >> >> > >> > > >> > > >> > > >> > > >> > ------------------------------------------------------------------------------ > >> > _______________________________________________ > >> > Matplotlib-users mailing list > >> > Mat...@li... > >> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > >> > >> > >> > >> > ------------------------------------------------------------------------------ > >> _______________________________________________ > >> Matplotlib-users mailing list > >> Mat...@li... > >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users > >> > > > > > > > ------------------------------------------------------------------------------ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
From: Bilheux, Jean-C. <bil...@or...> - 2015-06-03 13:54:53
|
Works for me too using plt.grid() but I can't find the way to customize the grid (size, type…)? trying http://matplotlib.org/examples/pylab_examples/axes_props.html doesn't do anything for me ! On Jun 3, 2015, at 9:39 AM, <st...@th...> wrote: > But this works: > > import matplotlib.pyplot as plt > import numpy as np > > fig = plt.figure() > ax = fig.add_subplot(1,1,1) > > x = np.linspace(0,10,50) > y = np.sin(x) > > plt.clf() > > plt.clf() > plt.plot(x,y) > leg = plt.legend(['legend 1']) > plt.title('Sample title') > plt.ylabel('Sample ylabel') > plt.xlabel('Sample xlabel') > > ax.set_xticks(np.arange(0, 10, 20)) > ax.set_xticks(np.arange(0, 10, 5), minor=True) > ax.set_yticks(np.arange(-1,1,20)) > ax.set_yticks(np.arange(-1,1,20), minor=True) > > ax.minorticks_on() > plt.grid(True) > plt.show() > > >> Hm, I tried both suggestions, and still no grid (removed PDF for >> simplicity): >> >> import matplotlib.pyplot as plt >> import numpy as np >> >> fig = plt.figure() >> ax = fig.add_subplot(1,1,1) >> >> x = np.linspace(0,10,50) >> y = np.sin(x) >> >> plt.clf() >> >> plt.clf() >> plt.plot(x,y) >> leg = plt.legend(['legend 1']) >> plt.title('Sample title') >> ax.set_ylabel('Sample ylabel') >> ax.set_xlabel('Sample xlabel') >> >> ax.set_xticks(np.arange(0, 10, 20)) >> ax.set_xticks(np.arange(0, 10, 5), minor=True) >> ax.set_yticks(np.arange(-1,1,20)) >> ax.set_yticks(np.arange(-1,1,20), minor=True) >> >> ax.minorticks_on() >> ax.grid('on') >> plt.show() >> >> >> >>> And if you meant 'grid', I guess >>> >>> ax.grid('on') >>> >>> should be added. >>> >>> * Youngung Jeong, ì .ì~ì>.* >>> >>> On Mon, Jun 1, 2015 at 4:38 PM, Sterling Smith <sm...@fu...> >>> wrote: >>> >>>> Stephen, >>>> >>>> In your script, you give >>>> ax.minorticks_on >>>> but you need to call that function for anything to occur >>>> ax.minorticks_on() >>>> >>>> >>>> Also, did you see >>>> http://matplotlib.org/examples/pylab_examples/axes_props.html >>>> in case your original question was not answered. >>>> >>>> -Sterling >>>> >>>> On Jun 1, 2015, at 1:24PM, st...@th... wrote: >>>> >>>>> I only see that you added "plt.show()", but neither the grid or the >>>> axis >>>>> labels are showing up. >>>>> >>>>>> Here is what I see with a couple of things modified ? >>>>>> did you expect something else ? >>>>>> >>>>>> from matplotlib.backends.backend_pdf import PdfPages >>>>>> import matplotlib.pyplot as plt >>>>>> import numpy as np >>>>>> >>>>>> fig = plt.figure() >>>>>> ax = fig.add_subplot(1,1,1) >>>>>> >>>>>> x = np.linspace(0,10,50) >>>>>> y = np.sin(x) >>>>>> >>>>>> with PdfPages('grid_test.pdf') as pdf: >>>>>> plt.clf() >>>>>> >>>>>> plt.clf() >>>>>> plt.plot(x,y) >>>>>> leg = plt.legend(['legend 1']) >>>>>> plt.title('Sample title') >>>>>> ax.set_ylabel('Sample ylabel') >>>>>> ax.set_xlabel('Sample xlabel') >>>>>> >>>>>> ax.set_xticks(np.arange(0, 10, 20)) >>>>>> ax.set_xticks(np.arange(0, 10, 5), minor=True) >>>>>> ax.set_yticks(np.arange(-1,1,20)) >>>>>> ax.set_yticks(np.arange(-1,1,20), minor=True) >>>>>> >>>>>> ax.minorticks_on >>>>>> plt.show() >>>>>> >>>>>> pdf.savefig() >>>>>> >>>>>> >>>>>> [cid:8C8...@or...] >>>>>> >>>>>> >>>>>> >>>>>> On Jun 1, 2015, at 2:49 PM, >>>>>> <st...@th...<mailto:st...@th...>> >>>>>> wrote: >>>>>> >>>>>> I am having an issue with the grid not appearing that I cannot >>>> figure >>>> out. >>>>>> Can anyone help? Thanks. --StephenB >>>>>> >>>>>> from matplotlib.backends.backend_pdf import PdfPages >>>>>> import matplotlib.pyplot as plt >>>>>> import numpy as np >>>>>> >>>>>> fig = plt.figure() >>>>>> ax = fig.add_subplot(1,1,1) >>>>>> >>>>>> x = np.linspace(0,10,50) >>>>>> y = np.sin(x) >>>>>> >>>>>> with PdfPages('grid_test.pdf') as pdf: >>>>>> plt.clf() >>>>>> >>>>>> plt.clf() >>>>>> plt.plot(x,y) >>>>>> leg = plt.legend(['legend 1']) >>>>>> plt.title('Sample title') >>>>>> ax.set_ylabel('Sample ylabel') >>>>>> ax.set_xlabel('Sample xlabel') >>>>>> >>>>>> ax.set_xticks(np.arange(0, 10, 20)) >>>>>> ax.set_xticks(np.arange(0, 10, 5), minor=True) >>>>>> ax.set_yticks(np.arange(-1,1,20)) >>>>>> ax.set_yticks(np.arange(-1,1,20), minor=True) >>>>>> >>>>>> ax.minorticks_on >>>>>> >>>>>> pdf.savefig() >>>>>> >>>>>> >>>>>> >>>> ------------------------------------------------------------------------------ >>>>>> _______________________________________________ >>>>>> Matplotlib-users mailing list >>>>>> Mat...@li...<mailto: >>>> Mat...@li...> >>>>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >>>>>> >>>>>> >>>>>> >>>>> >>>>> >>>>> >>>>> >>>> ------------------------------------------------------------------------------ >>>>> _______________________________________________ >>>>> Matplotlib-users mailing list >>>>> Mat...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >>>> >>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> _______________________________________________ >>>> Matplotlib-users mailing list >>>> Mat...@li... >>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >>>> >>> >> >> >> >> ------------------------------------------------------------------------------ >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> > > > > ------------------------------------------------------------------------------ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
From: <st...@th...> - 2015-06-03 13:39:33
|
But this works: import matplotlib.pyplot as plt import numpy as np fig = plt.figure() ax = fig.add_subplot(1,1,1) x = np.linspace(0,10,50) y = np.sin(x) plt.clf() plt.clf() plt.plot(x,y) leg = plt.legend(['legend 1']) plt.title('Sample title') plt.ylabel('Sample ylabel') plt.xlabel('Sample xlabel') ax.set_xticks(np.arange(0, 10, 20)) ax.set_xticks(np.arange(0, 10, 5), minor=True) ax.set_yticks(np.arange(-1,1,20)) ax.set_yticks(np.arange(-1,1,20), minor=True) ax.minorticks_on() plt.grid(True) plt.show() > Hm, I tried both suggestions, and still no grid (removed PDF for > simplicity): > > import matplotlib.pyplot as plt > import numpy as np > > fig = plt.figure() > ax = fig.add_subplot(1,1,1) > > x = np.linspace(0,10,50) > y = np.sin(x) > > plt.clf() > > plt.clf() > plt.plot(x,y) > leg = plt.legend(['legend 1']) > plt.title('Sample title') > ax.set_ylabel('Sample ylabel') > ax.set_xlabel('Sample xlabel') > > ax.set_xticks(np.arange(0, 10, 20)) > ax.set_xticks(np.arange(0, 10, 5), minor=True) > ax.set_yticks(np.arange(-1,1,20)) > ax.set_yticks(np.arange(-1,1,20), minor=True) > > ax.minorticks_on() > ax.grid('on') > plt.show() > > > >> And if you meant 'grid', I guess >> >> ax.grid('on') >> >> should be added. >> >> * Youngung Jeong, ì ìì * >> >> On Mon, Jun 1, 2015 at 4:38 PM, Sterling Smith <sm...@fu...> >> wrote: >> >>> Stephen, >>> >>> In your script, you give >>> ax.minorticks_on >>> but you need to call that function for anything to occur >>> ax.minorticks_on() >>> >>> >>> Also, did you see >>> http://matplotlib.org/examples/pylab_examples/axes_props.html >>> in case your original question was not answered. >>> >>> -Sterling >>> >>> On Jun 1, 2015, at 1:24PM, st...@th... wrote: >>> >>> > I only see that you added "plt.show()", but neither the grid or the >>> axis >>> > labels are showing up. >>> > >>> >> Here is what I see with a couple of things modified ? >>> >> did you expect something else ? >>> >> >>> >> from matplotlib.backends.backend_pdf import PdfPages >>> >> import matplotlib.pyplot as plt >>> >> import numpy as np >>> >> >>> >> fig = plt.figure() >>> >> ax = fig.add_subplot(1,1,1) >>> >> >>> >> x = np.linspace(0,10,50) >>> >> y = np.sin(x) >>> >> >>> >> with PdfPages('grid_test.pdf') as pdf: >>> >> plt.clf() >>> >> >>> >> plt.clf() >>> >> plt.plot(x,y) >>> >> leg = plt.legend(['legend 1']) >>> >> plt.title('Sample title') >>> >> ax.set_ylabel('Sample ylabel') >>> >> ax.set_xlabel('Sample xlabel') >>> >> >>> >> ax.set_xticks(np.arange(0, 10, 20)) >>> >> ax.set_xticks(np.arange(0, 10, 5), minor=True) >>> >> ax.set_yticks(np.arange(-1,1,20)) >>> >> ax.set_yticks(np.arange(-1,1,20), minor=True) >>> >> >>> >> ax.minorticks_on >>> >> plt.show() >>> >> >>> >> pdf.savefig() >>> >> >>> >> >>> >> [cid:8C8...@or...] >>> >> >>> >> >>> >> >>> >> On Jun 1, 2015, at 2:49 PM, >>> >> <st...@th...<mailto:st...@th...>> >>> >> wrote: >>> >> >>> >> I am having an issue with the grid not appearing that I cannot >>> figure >>> out. >>> >> Can anyone help? Thanks. --StephenB >>> >> >>> >> from matplotlib.backends.backend_pdf import PdfPages >>> >> import matplotlib.pyplot as plt >>> >> import numpy as np >>> >> >>> >> fig = plt.figure() >>> >> ax = fig.add_subplot(1,1,1) >>> >> >>> >> x = np.linspace(0,10,50) >>> >> y = np.sin(x) >>> >> >>> >> with PdfPages('grid_test.pdf') as pdf: >>> >> plt.clf() >>> >> >>> >> plt.clf() >>> >> plt.plot(x,y) >>> >> leg = plt.legend(['legend 1']) >>> >> plt.title('Sample title') >>> >> ax.set_ylabel('Sample ylabel') >>> >> ax.set_xlabel('Sample xlabel') >>> >> >>> >> ax.set_xticks(np.arange(0, 10, 20)) >>> >> ax.set_xticks(np.arange(0, 10, 5), minor=True) >>> >> ax.set_yticks(np.arange(-1,1,20)) >>> >> ax.set_yticks(np.arange(-1,1,20), minor=True) >>> >> >>> >> ax.minorticks_on >>> >> >>> >> pdf.savefig() >>> >> >>> >> >>> >> >>> ------------------------------------------------------------------------------ >>> >> _______________________________________________ >>> >> Matplotlib-users mailing list >>> >> Mat...@li...<mailto: >>> Mat...@li...> >>> >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >>> >> >>> >> >>> >> >>> > >>> > >>> > >>> > >>> ------------------------------------------------------------------------------ >>> > _______________________________________________ >>> > Matplotlib-users mailing list >>> > Mat...@li... >>> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users >>> >>> >>> >>> ------------------------------------------------------------------------------ >>> _______________________________________________ >>> Matplotlib-users mailing list >>> Mat...@li... >>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >>> >> > > > > ------------------------------------------------------------------------------ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
From: <st...@th...> - 2015-06-03 13:28:06
|
Hm, I tried both suggestions, and still no grid (removed PDF for simplicity): import matplotlib.pyplot as plt import numpy as np fig = plt.figure() ax = fig.add_subplot(1,1,1) x = np.linspace(0,10,50) y = np.sin(x) plt.clf() plt.clf() plt.plot(x,y) leg = plt.legend(['legend 1']) plt.title('Sample title') ax.set_ylabel('Sample ylabel') ax.set_xlabel('Sample xlabel') ax.set_xticks(np.arange(0, 10, 20)) ax.set_xticks(np.arange(0, 10, 5), minor=True) ax.set_yticks(np.arange(-1,1,20)) ax.set_yticks(np.arange(-1,1,20), minor=True) ax.minorticks_on() ax.grid('on') plt.show() > And if you meant 'grid', I guess > > ax.grid('on') > > should be added. > > * Youngung Jeong, ì ìì * > > On Mon, Jun 1, 2015 at 4:38 PM, Sterling Smith <sm...@fu...> > wrote: > >> Stephen, >> >> In your script, you give >> ax.minorticks_on >> but you need to call that function for anything to occur >> ax.minorticks_on() >> >> >> Also, did you see >> http://matplotlib.org/examples/pylab_examples/axes_props.html >> in case your original question was not answered. >> >> -Sterling >> >> On Jun 1, 2015, at 1:24PM, st...@th... wrote: >> >> > I only see that you added "plt.show()", but neither the grid or the >> axis >> > labels are showing up. >> > >> >> Here is what I see with a couple of things modified ? >> >> did you expect something else ? >> >> >> >> from matplotlib.backends.backend_pdf import PdfPages >> >> import matplotlib.pyplot as plt >> >> import numpy as np >> >> >> >> fig = plt.figure() >> >> ax = fig.add_subplot(1,1,1) >> >> >> >> x = np.linspace(0,10,50) >> >> y = np.sin(x) >> >> >> >> with PdfPages('grid_test.pdf') as pdf: >> >> plt.clf() >> >> >> >> plt.clf() >> >> plt.plot(x,y) >> >> leg = plt.legend(['legend 1']) >> >> plt.title('Sample title') >> >> ax.set_ylabel('Sample ylabel') >> >> ax.set_xlabel('Sample xlabel') >> >> >> >> ax.set_xticks(np.arange(0, 10, 20)) >> >> ax.set_xticks(np.arange(0, 10, 5), minor=True) >> >> ax.set_yticks(np.arange(-1,1,20)) >> >> ax.set_yticks(np.arange(-1,1,20), minor=True) >> >> >> >> ax.minorticks_on >> >> plt.show() >> >> >> >> pdf.savefig() >> >> >> >> >> >> [cid:8C8...@or...] >> >> >> >> >> >> >> >> On Jun 1, 2015, at 2:49 PM, >> >> <st...@th...<mailto:st...@th...>> >> >> wrote: >> >> >> >> I am having an issue with the grid not appearing that I cannot figure >> out. >> >> Can anyone help? Thanks. --StephenB >> >> >> >> from matplotlib.backends.backend_pdf import PdfPages >> >> import matplotlib.pyplot as plt >> >> import numpy as np >> >> >> >> fig = plt.figure() >> >> ax = fig.add_subplot(1,1,1) >> >> >> >> x = np.linspace(0,10,50) >> >> y = np.sin(x) >> >> >> >> with PdfPages('grid_test.pdf') as pdf: >> >> plt.clf() >> >> >> >> plt.clf() >> >> plt.plot(x,y) >> >> leg = plt.legend(['legend 1']) >> >> plt.title('Sample title') >> >> ax.set_ylabel('Sample ylabel') >> >> ax.set_xlabel('Sample xlabel') >> >> >> >> ax.set_xticks(np.arange(0, 10, 20)) >> >> ax.set_xticks(np.arange(0, 10, 5), minor=True) >> >> ax.set_yticks(np.arange(-1,1,20)) >> >> ax.set_yticks(np.arange(-1,1,20), minor=True) >> >> >> >> ax.minorticks_on >> >> >> >> pdf.savefig() >> >> >> >> >> >> >> ------------------------------------------------------------------------------ >> >> _______________________________________________ >> >> Matplotlib-users mailing list >> >> Mat...@li...<mailto: >> Mat...@li...> >> >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> >> >> >> >> >> >> > >> > >> > >> > >> ------------------------------------------------------------------------------ >> > _______________________________________________ >> > Matplotlib-users mailing list >> > Mat...@li... >> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> >> >> >> ------------------------------------------------------------------------------ >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> > |
From: Youngung J. <you...@gm...> - 2015-06-01 21:24:32
|
And if you meant 'grid', I guess ax.grid('on') should be added. * Youngung Jeong, 정영웅* On Mon, Jun 1, 2015 at 4:38 PM, Sterling Smith <sm...@fu...> wrote: > Stephen, > > In your script, you give > ax.minorticks_on > but you need to call that function for anything to occur > ax.minorticks_on() > > > Also, did you see > http://matplotlib.org/examples/pylab_examples/axes_props.html > in case your original question was not answered. > > -Sterling > > On Jun 1, 2015, at 1:24PM, st...@th... wrote: > > > I only see that you added "plt.show()", but neither the grid or the axis > > labels are showing up. > > > >> Here is what I see with a couple of things modified ? > >> did you expect something else ? > >> > >> from matplotlib.backends.backend_pdf import PdfPages > >> import matplotlib.pyplot as plt > >> import numpy as np > >> > >> fig = plt.figure() > >> ax = fig.add_subplot(1,1,1) > >> > >> x = np.linspace(0,10,50) > >> y = np.sin(x) > >> > >> with PdfPages('grid_test.pdf') as pdf: > >> plt.clf() > >> > >> plt.clf() > >> plt.plot(x,y) > >> leg = plt.legend(['legend 1']) > >> plt.title('Sample title') > >> ax.set_ylabel('Sample ylabel') > >> ax.set_xlabel('Sample xlabel') > >> > >> ax.set_xticks(np.arange(0, 10, 20)) > >> ax.set_xticks(np.arange(0, 10, 5), minor=True) > >> ax.set_yticks(np.arange(-1,1,20)) > >> ax.set_yticks(np.arange(-1,1,20), minor=True) > >> > >> ax.minorticks_on > >> plt.show() > >> > >> pdf.savefig() > >> > >> > >> [cid:8C8...@or...] > >> > >> > >> > >> On Jun 1, 2015, at 2:49 PM, > >> <st...@th...<mailto:st...@th...>> > >> wrote: > >> > >> I am having an issue with the grid not appearing that I cannot figure > out. > >> Can anyone help? Thanks. --StephenB > >> > >> from matplotlib.backends.backend_pdf import PdfPages > >> import matplotlib.pyplot as plt > >> import numpy as np > >> > >> fig = plt.figure() > >> ax = fig.add_subplot(1,1,1) > >> > >> x = np.linspace(0,10,50) > >> y = np.sin(x) > >> > >> with PdfPages('grid_test.pdf') as pdf: > >> plt.clf() > >> > >> plt.clf() > >> plt.plot(x,y) > >> leg = plt.legend(['legend 1']) > >> plt.title('Sample title') > >> ax.set_ylabel('Sample ylabel') > >> ax.set_xlabel('Sample xlabel') > >> > >> ax.set_xticks(np.arange(0, 10, 20)) > >> ax.set_xticks(np.arange(0, 10, 5), minor=True) > >> ax.set_yticks(np.arange(-1,1,20)) > >> ax.set_yticks(np.arange(-1,1,20), minor=True) > >> > >> ax.minorticks_on > >> > >> pdf.savefig() > >> > >> > >> > ------------------------------------------------------------------------------ > >> _______________________________________________ > >> Matplotlib-users mailing list > >> Mat...@li...<mailto: > Mat...@li...> > >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users > >> > >> > >> > > > > > > > > > ------------------------------------------------------------------------------ > > _______________________________________________ > > Matplotlib-users mailing list > > Mat...@li... > > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > > > ------------------------------------------------------------------------------ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
From: Sterling S. <sm...@fu...> - 2015-06-01 20:37:57
|
Stephen, In your script, you give ax.minorticks_on but you need to call that function for anything to occur ax.minorticks_on() Also, did you see http://matplotlib.org/examples/pylab_examples/axes_props.html in case your original question was not answered. -Sterling On Jun 1, 2015, at 1:24PM, st...@th... wrote: > I only see that you added "plt.show()", but neither the grid or the axis > labels are showing up. > >> Here is what I see with a couple of things modified ? >> did you expect something else ? >> >> from matplotlib.backends.backend_pdf import PdfPages >> import matplotlib.pyplot as plt >> import numpy as np >> >> fig = plt.figure() >> ax = fig.add_subplot(1,1,1) >> >> x = np.linspace(0,10,50) >> y = np.sin(x) >> >> with PdfPages('grid_test.pdf') as pdf: >> plt.clf() >> >> plt.clf() >> plt.plot(x,y) >> leg = plt.legend(['legend 1']) >> plt.title('Sample title') >> ax.set_ylabel('Sample ylabel') >> ax.set_xlabel('Sample xlabel') >> >> ax.set_xticks(np.arange(0, 10, 20)) >> ax.set_xticks(np.arange(0, 10, 5), minor=True) >> ax.set_yticks(np.arange(-1,1,20)) >> ax.set_yticks(np.arange(-1,1,20), minor=True) >> >> ax.minorticks_on >> plt.show() >> >> pdf.savefig() >> >> >> [cid:8C8...@or...] >> >> >> >> On Jun 1, 2015, at 2:49 PM, >> <st...@th...<mailto:st...@th...>> >> wrote: >> >> I am having an issue with the grid not appearing that I cannot figure out. >> Can anyone help? Thanks. --StephenB >> >> from matplotlib.backends.backend_pdf import PdfPages >> import matplotlib.pyplot as plt >> import numpy as np >> >> fig = plt.figure() >> ax = fig.add_subplot(1,1,1) >> >> x = np.linspace(0,10,50) >> y = np.sin(x) >> >> with PdfPages('grid_test.pdf') as pdf: >> plt.clf() >> >> plt.clf() >> plt.plot(x,y) >> leg = plt.legend(['legend 1']) >> plt.title('Sample title') >> ax.set_ylabel('Sample ylabel') >> ax.set_xlabel('Sample xlabel') >> >> ax.set_xticks(np.arange(0, 10, 20)) >> ax.set_xticks(np.arange(0, 10, 5), minor=True) >> ax.set_yticks(np.arange(-1,1,20)) >> ax.set_yticks(np.arange(-1,1,20), minor=True) >> >> ax.minorticks_on >> >> pdf.savefig() >> >> >> ------------------------------------------------------------------------------ >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li...<mailto:Mat...@li...> >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> >> >> > > > > ------------------------------------------------------------------------------ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
From: <st...@th...> - 2015-06-01 20:24:44
|
I only see that you added "plt.show()", but neither the grid or the axis labels are showing up. > Here is what I see with a couple of things modified ? > did you expect something else ? > > from matplotlib.backends.backend_pdf import PdfPages > import matplotlib.pyplot as plt > import numpy as np > > fig = plt.figure() > ax = fig.add_subplot(1,1,1) > > x = np.linspace(0,10,50) > y = np.sin(x) > > with PdfPages('grid_test.pdf') as pdf: > plt.clf() > > plt.clf() > plt.plot(x,y) > leg = plt.legend(['legend 1']) > plt.title('Sample title') > ax.set_ylabel('Sample ylabel') > ax.set_xlabel('Sample xlabel') > > ax.set_xticks(np.arange(0, 10, 20)) > ax.set_xticks(np.arange(0, 10, 5), minor=True) > ax.set_yticks(np.arange(-1,1,20)) > ax.set_yticks(np.arange(-1,1,20), minor=True) > > ax.minorticks_on > plt.show() > > pdf.savefig() > > > [cid:8C8...@or...] > > > > On Jun 1, 2015, at 2:49 PM, > <st...@th...<mailto:st...@th...>> > wrote: > > I am having an issue with the grid not appearing that I cannot figure out. > Can anyone help? Thanks. --StephenB > > from matplotlib.backends.backend_pdf import PdfPages > import matplotlib.pyplot as plt > import numpy as np > > fig = plt.figure() > ax = fig.add_subplot(1,1,1) > > x = np.linspace(0,10,50) > y = np.sin(x) > > with PdfPages('grid_test.pdf') as pdf: > plt.clf() > > plt.clf() > plt.plot(x,y) > leg = plt.legend(['legend 1']) > plt.title('Sample title') > ax.set_ylabel('Sample ylabel') > ax.set_xlabel('Sample xlabel') > > ax.set_xticks(np.arange(0, 10, 20)) > ax.set_xticks(np.arange(0, 10, 5), minor=True) > ax.set_yticks(np.arange(-1,1,20)) > ax.set_yticks(np.arange(-1,1,20), minor=True) > > ax.minorticks_on > > pdf.savefig() > > > ------------------------------------------------------------------------------ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li...<mailto:Mat...@li...> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > > |
From: Bilheux, Jean-C. <bil...@or...> - 2015-06-01 19:21:52
|
Here is what I see with a couple of things modified ? did you expect something else ? from matplotlib.backends.backend_pdf import PdfPages import matplotlib.pyplot as plt import numpy as np fig = plt.figure() ax = fig.add_subplot(1,1,1) x = np.linspace(0,10,50) y = np.sin(x) with PdfPages('grid_test.pdf') as pdf: plt.clf() plt.clf() plt.plot(x,y) leg = plt.legend(['legend 1']) plt.title('Sample title') ax.set_ylabel('Sample ylabel') ax.set_xlabel('Sample xlabel') ax.set_xticks(np.arange(0, 10, 20)) ax.set_xticks(np.arange(0, 10, 5), minor=True) ax.set_yticks(np.arange(-1,1,20)) ax.set_yticks(np.arange(-1,1,20), minor=True) ax.minorticks_on plt.show() pdf.savefig() [cid:8C8...@or...] On Jun 1, 2015, at 2:49 PM, <st...@th...<mailto:st...@th...>> wrote: I am having an issue with the grid not appearing that I cannot figure out. Can anyone help? Thanks. --StephenB from matplotlib.backends.backend_pdf import PdfPages import matplotlib.pyplot as plt import numpy as np fig = plt.figure() ax = fig.add_subplot(1,1,1) x = np.linspace(0,10,50) y = np.sin(x) with PdfPages('grid_test.pdf') as pdf: plt.clf() plt.clf() plt.plot(x,y) leg = plt.legend(['legend 1']) plt.title('Sample title') ax.set_ylabel('Sample ylabel') ax.set_xlabel('Sample xlabel') ax.set_xticks(np.arange(0, 10, 20)) ax.set_xticks(np.arange(0, 10, 5), minor=True) ax.set_yticks(np.arange(-1,1,20)) ax.set_yticks(np.arange(-1,1,20), minor=True) ax.minorticks_on pdf.savefig() ------------------------------------------------------------------------------ _______________________________________________ Matplotlib-users mailing list Mat...@li...<mailto:Mat...@li...> https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
From: <st...@th...> - 2015-06-01 19:06:57
|
I am having an issue with the grid not appearing that I cannot figure out. Can anyone help? Thanks. --StephenB from matplotlib.backends.backend_pdf import PdfPages import matplotlib.pyplot as plt import numpy as np fig = plt.figure() ax = fig.add_subplot(1,1,1) x = np.linspace(0,10,50) y = np.sin(x) with PdfPages('grid_test.pdf') as pdf: plt.clf() plt.clf() plt.plot(x,y) leg = plt.legend(['legend 1']) plt.title('Sample title') ax.set_ylabel('Sample ylabel') ax.set_xlabel('Sample xlabel') ax.set_xticks(np.arange(0, 10, 20)) ax.set_xticks(np.arange(0, 10, 5), minor=True) ax.set_yticks(np.arange(-1,1,20)) ax.set_yticks(np.arange(-1,1,20), minor=True) ax.minorticks_on pdf.savefig() |