Git Product home page Git Product logo

Comments (2)

leotac avatar leotac commented on July 19, 2024 3

Yeah, passing an axis is only half-working at the moment, I didn't fully implement it.

You can get something working by passing a list of axis with the same length of the data you want to plot -- in this example, I'm passing two dataframes with 3 columns each, and for each function call, I'm passing the 3 axes where the plot will be drawn.

f, axes = plt.subplots(3,2)
first_column = [axes[i][0] for i in range(3)]
second_column = [axes[i][1] for i in range(3)]

joypy.joyplot(df[["Monday","Tuesday","Wednesday"]], ax=first_column)
joypy.joyplot(df[["Thursday", "Friday", "Saturday"]], ax=second_column)

This does work, in a way; however, the ticks on the x axis will be off, like this:

download

Indeed the x ticks are those of the second plot, that are applied to the whole fig.
At some point I implemented a workaround to get things working, if I find the time I'll push it.

from joypy.

mkkubins avatar mkkubins commented on July 19, 2024

Hi!
I am trying to do subplots and I have question if there is possibility to get rid of this strange x axis becasue I dont know how to turn it off or how to replace this somethow to work.
image

font=12
f, axes = plt.subplots(19,4,figsize=(15, 6))
first_column = np.array([axes[i][0] for i in range(19)])
second_column = np.array([axes[i][1] for i in range(19)])
third_column = np.array([axes[i][2] for i in range(19)])
fourth_column = np.array([axes[i][3] for i in range(19)])

joyplot(sub_list[0], ax=first_column,color=colors[stim[0]],overlap=1,xlim=None)
plt.figtext(0.09,0.92,stim[0],fontweight='bold',fontsize=font) 
joyplot(sub_list[1], ax=second_column,color=colors[stim[1]],overlap=1,ylabels=False)
plt.figtext(0.35,0.92,stim[1],fontweight='bold',fontsize=font) 
joyplot(sub_list[2], ax=third_column,color=colors[stim[2]],overlap=1,ylabels=False)
plt.figtext(0.59,0.92,stim[2],fontweight='bold',fontsize=font)
joyplot(sub_list[3], ax=fourth_column,color=colors[stim[3]],overlap=1,ylabels=False)
plt.figtext(0.82,0.92,stim[3],fontweight='bold',fontsize=font)
plt.xticks(ticks=None)

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.