Giter VIP home page Giter VIP logo

Comments (5)

araikes avatar araikes commented on June 8, 2024

Also, is there a way to edit the x-axis tick labels? My variable names aren't pretty and I don't like spaces in them so they don't read nicely.

Thanks

from dabest-python.

josesho avatar josesho commented on June 8, 2024

Is there a recommended way of saving high-res plots with axis titles that are readable.

The easiest way to do this is with seaborn's set function.

import seaborn as sns
sns.set(style='ticks', font_scale=1.5)

This, however, will scale the font for all text features. To specifically change the axis titles, directly assign the desired font size to matplotlib's rcParams.

import matplotlib.pyplot as plt
plt.rcParams['axes.labelsize'] = 16

Note that this will set global options for any figures created; if you are generating figures that need a different label size, you will need to reset/reassign the label size before plotting.

Also, is there a way to edit the x-axis tick labels? My variable names aren't pretty and I don't like spaces in them so they don't read nicely.

Consider re-naming your group names in pandas before plotting. To directly 'edit' these, you will need to access the appropriate Axes (see here) and use matplotlib (see here for more details) :

f = two_groups_unpaired.mean_diff.plot();

rawdata_axes = f.axes[0]
effsize_axes = f.axes[1]

rawdata_axes.set_xticklabels(["blue group", "orange!"])
effsize_axes.set_xticklabels(["", "my difference"]) # The xtick is actually plotted at position "1".

image

Thanks,
Joses

from dabest-python.

araikes avatar araikes commented on June 8, 2024

Excellent. Thanks @josesho .

from dabest-python.

araikes avatar araikes commented on June 8, 2024

Sorry, last question on this @josesho ( I know it's closed but oh well)... What about removing the legend. I'm using colors for contrast but not to differentiate things to where a legend is needed. Is there anyway to get rid of it. For reference, I'm trying to do the multi-axis plot in the tutorial and the legends end up underneath the other plots.

Thanks

from dabest-python.

araikes avatar araikes commented on June 8, 2024

Nevermind... took too long but figured it out.

topleft_axes = axx.flat[0]
topleft_axes.contrast_axes.get_legend().remove()

from dabest-python.

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.