Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gridlines and inverted mode #4

Closed
wants to merge 1 commit into from
Closed

Gridlines and inverted mode #4

wants to merge 1 commit into from

Conversation

z-m-k
Copy link

@z-m-k z-m-k commented May 26, 2014

Two switches in the plot() function which allow to:

  • add gridlines with gridlines=true
  • invert the plot with invert=true
  • both

It comes in handy if Braille blank, 0x2800, has different width than
the remaining characters in the range.

Example without gridlines:
image

Example with gridlines:
image

Two switches in the `plot()` function which allow to:

* add gridlines with `gridlines=true`
* invert the plot with `invert=true`
* both

It comes in handy if Braille blank, `0x2800`, has different width than
the remaining characters in the range.
@waldyrious
Copy link
Contributor

I wonder if there is another way to workaround the inconsistent width of the Braille blank without using the gridlines. Maybe one of these consistently matches the proper width?

@sunetos
Copy link
Owner

sunetos commented May 26, 2014

In a monospaced font, when would the width ever be inconsistent? What font are you using? I think it's safe to say that TextPlots is pretty dependent on a monospaced font.

@z-m-k
Copy link
Author

z-m-k commented May 26, 2014

Source Code Pro/Consolas. I think it is a Windows thing, though.

@sunetos
Copy link
Owner

sunetos commented May 26, 2014

Even the regular space character is sized incorrectly in your screenshots: the axis label (max x value) in the bottom-right is normally right-aligned with the edge of the graph, but it extends further right in your screenshot. I'm not sure how that's possible with a monospaced font.

@sunetos sunetos closed this in 7f57fff May 26, 2014
@sunetos
Copy link
Owner

sunetos commented May 26, 2014

Either way, thanks for the pull request! I can't see any reason not to support these parameters. I hope you don't mind that I rewrote it to be quite a bit shorter, and fixed 2 bugs I found:

  1. Combining invert=true, gridlines=true wasn't an exact inversion of invert=false, gridlines = true (the gridline was in a different place).
  2. Since you were setting the char each time in showdot() instead of bitwise ORing, it failed when plotting multiple Y values with the same X value.

I will update the version in METADATA.jl in a day or so with this addition after making sure no bugs pop up. You can test it with Pkg.clone("https://github.com/sunetos/TextPlots.jl/").

@z-m-k
Copy link
Author

z-m-k commented May 26, 2014

Nice. I will admit it took me some time to actually figure out what is going on there, and since I assumed this might be localized to my machine only, it felt stupid just to complain something is not working without proposing a way to fix it. It does feel silly how little you changed compared to the original code to get the same/better effect than after what I did.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants