olgabot / prettyplotlib

Painlessly create beautiful matplotlib plots.
olgabot.github.io/prettyplotlib
MIT License
1.69k stars 148 forks source link

labels #14

Closed casraz closed 10 years ago

casraz commented 10 years ago

when having more than about 25 lables on the x-axis (say 50) is not handled properly(overlapping lables) or is there a command to fix it ?

RyanGladstone commented 10 years ago

Hi @casraz

Were you ever able to address this issue? I'm also having trouble wrangling the labels at the moment.

Thanks,

Ryan

olgabot commented 10 years ago

Hi! Sorry about leaving this for a while. Are you thinking a larger figure size or smaller font size, or a combination of both?


Olga Botvinnik PhD Program in Bioinformatics and Systems Biology Gene Yeo Laboratory | Sanford Consortium for Regenerative Medicine University of California, San Diego olgabotvinnik.com blog.olgabotvinnik.com github.com/olgabot

On Tue, Jan 14, 2014 at 10:32 AM, Ryan Gladstone notifications@github.comwrote:

Hi @casraz https://github.com/casraz

Were you ever able to address this issue? I'm also having trouble wrangling the labels at the moment.

Thanks,

Ryan

— Reply to this email directly or view it on GitHubhttps://github.com/olgabot/prettyplotlib/issues/14#issuecomment-32292537 .

casraz commented 10 years ago

Hi . . . well, why not both ? lets say one has 50 different data sets and wants to put 50 box plots on a figure. that would be nice . . . however, when you have many boxes, then the visuals could become less effective unless the boundary of each box has the right thickness and colour.

cheers

On 2014-01-14, at 3:03 PM, Olga Botvinnik notifications@github.com wrote:

Hi! Sorry about leaving this for a while. Are you thinking a larger figure size or smaller font size, or a combination of both?


Olga Botvinnik PhD Program in Bioinformatics and Systems Biology Gene Yeo Laboratory | Sanford Consortium for Regenerative Medicine University of California, San Diego olgabotvinnik.com blog.olgabotvinnik.com github.com/olgabot

On Tue, Jan 14, 2014 at 10:32 AM, Ryan Gladstone notifications@github.comwrote:

Hi @casraz https://github.com/casraz

Were you ever able to address this issue? I'm also having trouble wrangling the labels at the moment.

Thanks,

Ryan

— Reply to this email directly or view it on GitHubhttps://github.com/olgabot/prettyplotlib/issues/14#issuecomment-32292537 .

— Reply to this email directly or view it on GitHub.

olgabot commented 10 years ago

I just worked on this feature (https://github.com/olgabot/prettyplotlib/compare/master...pcolormesh_labels .. ignore the fact that it's called pcolormesh labels for now). Now when you have >5 items, it auto-rotates the labels by 45 degrees:

http://nbviewer.ipython.org/gist/olgabot/8570414

How does it look to you?

mooreed commented 10 years ago

Unrelated to ticklabels, but still in regards to labels, namely axis labels: How would one apply axis labels using ppl vs the corresponding similar code shown below to print out horizontal and vertical axis labels using ugly .plot( ) ??

 gph1 = df1['Traffic Total'][:30].plot(title="Traffic Generated vs Top 30 Device Types")
 gph1.set_xlabel("Uniq Device Types Included ")
 gph1.set_ylabel("Traffic (# Records)")

I have tried the following which seemed reasonable, but I am operating on a list type:

 ppl_gph1 = ppl.plot(
      df1.index.values[:30], 
      df1['Traffic Total'][:30], 
      label="Traffic Totals")

 ppl_gph1.set_title("Title")

Any help displaying a Title and axis labels would be greatly appreciated for a charting noob. Looking for something like this... but prettier image

olgabot commented 10 years ago

Thank you for your comment. Unfortunately, I no longer have the bandwidth to maintain prettyplotlib. I recommend using seaborn. Using seaborn, to get the prettyplotlib style, do:

import seaborn as sns
sns.set(style='ticks', palette='Set2')

And to remove "chartjunk", do:

sns.despine()

If you have discrete pull requests, I will accept them, but I personally will no longer fix bugs.

If you are a biological scientist looking for ways to analyze your big-ish (20+ samples) data, check out my main project, flotilla.