Git Product home page Git Product logo

Comments (5)

leotac avatar leotac commented on August 19, 2024 1

You're right. The thing is, in my implementation, each one of the density subplots has its own axes, with their own xlim and ylim. Then there's an outer axis pair, behind all the other ones, that is used e.g. for xticks and xlabels. The xlim values of all the subplots are the same by construction, but there is no hard constraint that makes them so.
With matplotlib.pyplot.xlim(xmin, xmax) you're changing the lims of the current X axis -- whatever current means in this case. I guess it is the last one, i.e., the "container" axis, so you're not changing the xlims of the single subplots. To get that effect, you should loop over all the axes returned by joyplot (in your case, the first 4 are your density subplots, + the last one is the "container" one) and set the xlim of each of them.

from joypy.

leotac avatar leotac commented on August 19, 2024 1

Hi Tobias, you should apply set_xlabel to the last axes returned by the function. Something like this:

fig, axes = joypy.joyplot(data)
axes[-1].set_xlabel("My x label")

xlabel

from joypy.

jbloom avatar jbloom commented on August 19, 2024

OK, thanks.

from joypy.

TobiasWegener avatar TobiasWegener commented on August 19, 2024

Hallo, this is very nice tool and I would like to use it in my Phd thesis.
However, I have some issue to set the xlabel. I see in the example above, this seems possible?
Can you tell me how to do it the standard method I use with seaborn an matplotlib and pylab in the jupyter notebook is:
xlabel('label of x')
or similar.
but this gives back:

<ipython-input-316-4a720c777783> in <module>()
5 xlabel('some x labe')
TypeError: 'str' object is not callable

If I remove the xlabel, the plot works perfectly fine and looks like this.

05_all_grainsize_distribution_Joyplot.pdf

Thank you in advance, for this tool and all the best,
Tobias

ps. plt.xlabel('label of x') doesn't work either.

from joypy.

TobiasWegener avatar TobiasWegener commented on August 19, 2024

Hallo sbebo,
Ah, now I see, my fault.

Thank you very much for the fast help and the great work!
Best regards,

Tobias

from joypy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.