SourceForge logo
SourceForge logo
Menu

matplotlib-users

From: pb89 <pet...@gm...> - 2015年06月12日 22:10:16
hi guys, 
i guess thats an easy one for you: 
fig=plt.figure()
rect=fig.patch
rect.set_facecolor('white')
ax1=fig.add_subplot(111)
bp=boxplot(array)
xlabel('case ID')
ylabel('registration time, sec')
show()
whereas array is a list of lists with 25 entries.
i want to have the axis not from 0 to 25 but from 11 to 36. How can i do
that?
thanks
peter
--
View this message in context: http://matplotlib.1069221.n5.nabble.com/custom-x-axis-integers-boxplot-tp45769.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Jeff B. <jbl...@gm...> - 2015年06月12日 23:14:29
Try adding these lines before your call to plt.show():
 locs, labels = plt.xticks()
 plt.xticks(locs, np.arange(11, 36))
On Fri, Jun 12, 2015 at 3:10 PM, pb89 <pet...@gm...> wrote:
> hi guys,
>
> i guess thats an easy one for you:
>
> fig=plt.figure()
> rect=fig.patch
> rect.set_facecolor('white')
> ax1=fig.add_subplot(111)
> bp=boxplot(array)
>
> xlabel('case ID')
> ylabel('registration time, sec')
> show()
>
> whereas array is a list of lists with 25 entries.
>
> i want to have the axis not from 0 to 25 but from 11 to 36. How can i do
> that?
>
> thanks
> peter
>
>
>
>
> --
> View this message in context:
> http://matplotlib.1069221.n5.nabble.com/custom-x-axis-integers-boxplot-tp45769.html
> Sent from the matplotlib - users mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: pb89 <pet...@gm...> - 2015年06月12日 23:36:43
thanks for the quick answer Jeffrey, its working! 
-peter
--
View this message in context: http://matplotlib.1069221.n5.nabble.com/custom-x-axis-integers-boxplot-tp45769p45771.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Paul H. <pmh...@gm...> - 2015年06月13日 14:46:25
Probably a better way would be to the the "pos" arguments to boxplot
(bp=boxplot(array,
pos=range(11, 36)). That *should* work. Let me know if it doesn't.
On Fri, Jun 12, 2015 at 4:36 PM, pb89 <pet...@gm...> wrote:
> thanks for the quick answer Jeffrey, its working!
>
> -peter
>
>
>
> --
> View this message in context:
> http://matplotlib.1069221.n5.nabble.com/custom-x-axis-integers-boxplot-tp45769p45771.html
> Sent from the matplotlib - users mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: pb89 <pet...@gm...> - 2015年06月13日 14:49:33
it tried this before, but it throws an exception: 
TypeError: boxplot() got an unexpected keyword argument 'pos'
--
View this message in context: http://matplotlib.1069221.n5.nabble.com/custom-x-axis-integers-boxplot-tp45769p45774.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Paul H. <pmh...@gm...> - 2015年06月13日 14:58:56
Oh sorry that should be "... positions=np.arange(11, 36))
On Sat, Jun 13, 2015 at 7:49 AM, pb89 <pet...@gm...> wrote:
> it tried this before, but it throws an exception:
>
> TypeError: boxplot() got an unexpected keyword argument 'pos'
>
>
>
>
>
> --
> View this message in context:
> http://matplotlib.1069221.n5.nabble.com/custom-x-axis-integers-boxplot-tp45769p45774.html
> Sent from the matplotlib - users mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: pb89 <pet...@gm...> - 2015年06月13日 15:03:49
yes, that works as well! thanks for your suggestion
--
View this message in context: http://matplotlib.1069221.n5.nabble.com/custom-x-axis-integers-boxplot-tp45769p45776.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: pb89 <pet...@gm...> - 2015年06月16日 01:16:46
hey guys, is it also possible to only show every 5th number of that array?
Its a little too much right now: 
<http://matplotlib.1069221.n5.nabble.com/file/n45784/computationTime_slicer4_final.png> 
--
View this message in context: http://matplotlib.1069221.n5.nabble.com/custom-x-axis-integers-boxplot-tp45769p45784.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Paul H. <pmh...@gm...> - 2015年06月16日 15:52:45
You want to use a MultipleLocator:
http://matplotlib.org/examples/pylab_examples/major_minor_demo1.html
-paul
On Mon, Jun 15, 2015 at 6:16 PM, pb89 <pet...@gm...> wrote:
> hey guys, is it also possible to only show every 5th number of that array?
> Its a little too much right now:
> <
> http://matplotlib.1069221.n5.nabble.com/file/n45784/computationTime_slicer4_final.png
> >
>
>
>
> --
> View this message in context:
> http://matplotlib.1069221.n5.nabble.com/custom-x-axis-integers-boxplot-tp45769p45784.html
> Sent from the matplotlib - users mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





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

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

More information about our ad policies

Ad destination/click URL:

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