Menu

Y Flip

Rui Branco
2011-07-10
2012-10-17
  • Rui Branco

    Rui Branco - 2011-07-10

    Hello everyone

    I was looking in the manual and can not find a way

    do flip to the values ​​in Y.

    How can I do?

    I'm using the model:

    PHPlot # Example: OHLC (Financial) plot, basic lines, using

    External data file, text-data

     
  • lbayuk

    lbayuk - 2011-07-10

    There isn't any direct way to reverse the Y axis (making lower numbers show at
    the top and higher numbers below). This has come up a few times in the past,
    but it looks pretty hard to implement. The directions of the X axis and Y axis
    are such basic assumptions in the code, it looks like it would break a lot to
    try to change it.

    However, there is a method that might get you the results you want. You have
    to alter the Y values in your data array like Y' = M - Y, where M is some
    value larger than your largest Y value. Then you make a custom Y label
    function with SetYLabelType('custom', 'my_label_function'), which returns M-Y
    as the value, given Y. You should also set the Y data range to 0:M with
    SetPlotAreaWorld. This will result in Y tick labels starting with 0 at the
    top, and M at the bottom, with the data plotted accordingly. You can also move
    the X axis to the top, along with its tick labels and tick marks.

    There are probably some quirks with this, but I have 2 examples - a line plot
    and a bar chart - that seem to work fine. I can put them up on the site
    somewhere, if you want. Let me know.

    (You aren't really doing OHLC charts, are you? I can't think of any reason
    these would be valid with a reversed Y axis.)

     
  • Diego Vieira Cipriano

    eu preciso disso para gerar um gráfico de audiometria

     
  • lbayuk

    lbayuk - 2012-10-17

    Continued here
    with code example

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.