Giter Club home page Giter Club logo

Comments (5)

marcharper avatar marcharper commented on August 16, 2024

You just have to stretch the image after it is plotted by matplotlib. Just pull the pop up window's corners until the shape is just right.

Depending on your installation settings, the image may or may not be exactly equilateral as displayed, but it is equilateral as drawn. The error bar takes up some space (which varies based on the ticks of the color bar, the font size, etc.) so it's up to you to properly stretch the image before saving.

If that doesn't work and you need a publication quality image, I recommend that you make the plot with and without the colorbar and use e.g. photoshop or gimp to add the color bar to the image that you are happier with.

from python-ternary.

dwuab avatar dwuab commented on August 16, 2024

Manually stretching the image is certainly an option, but my biggest concern is whether the ticks automatically adjust to the stretching, i.e., whether the ticks are parallel to the corresponding side after stretching.

In my installation settings, the plot is still not equilateral even without the colorbar.

AFAIK, this does not happen to heatmapf nor other plotting functions I have tried.

from python-ternary.

marcharper avatar marcharper commented on August 16, 2024

Did you try stretching it? The ticks and labels should move with the axes. The library is specifically programmed to do so for this reason. If that doesn't work please let me know.

FYI some of the images in the documentation were stretched manually. Unfortunately there is not an easy way to determine how much space the various text blocks will take up that I am aware of, which is why the plot isn't automatically resized. There are also local matplotlib options that dictate e.g. default image dimensions, so it's unlikely that the library's behaviors on this matter will change in the near future.

from python-ternary.

dwuab avatar dwuab commented on August 16, 2024

I did not try stretching it because I mainly work with IPython notebook with inline image... good to know the ticks and labels will adjust. Also thanks for your elaboration on the issue!

from python-ternary.

marcharper avatar marcharper commented on August 16, 2024

You are welcome. In case you haven't seen this before, you can set the default figure size in a notebook with:

%matplotlib inline
matplotlib.rcParams['figure.figsize'] = (10, 6) # inches width and height.

from python-ternary.

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.