tammoippen / plotille

Plot in the terminal using braille dots.
MIT License
398 stars 17 forks source link

Not getting the graph as required #17

Closed pradeepu1995 closed 5 years ago

pradeepu1995 commented 6 years ago

Sir, I am searching for a library to draw graph in terminal and I found this library and used this, but the output is not getting as required. Please help out.

The code I used (which is given in readme of your library)

import  plotille
import numpy as np 
X = np.sort(np.random.normal(size=1000))
fig = plotille.Figure() 
fig.width = 60 
fig.height = 30 
fig.set_x_limits(min_=-3, max_=3)
fig.set_y_limits(min_=-1, max_=1) 
fig.color_mode = 'byte' 
fig.plot([-0.5, 1], [-1, 1], lc=25, label='First line')
fig.scatter(X, np.sin(X), lc=100, label='sin')  
fig.plot(X, (X+2)**2 , lc=200, label='square')
print(fig.show(legend=True))

The output what I got

The actual output (shown in read me)

Why I am getting the extra braille dots? Please help me. Waiting for your replay.

Thank you.

tammoippen commented 6 years ago

Hello,

Can you tell me, what OS, python version, plotille version, terminal and font you are using. This will help me reproduce the behavior and find a solution. Best, Tammo

pradeepu1995 commented 6 years ago

Thank you for your quick response,

OS - arch Linux (4.12)

Python version 3.6.2

plotille version 3.4

Terminal - xfce4-terminal (0.8.6)

Font - Monospace Regular

tammoippen commented 6 years ago

I am not 100% sure, but I would point to the font for the seen effect: all 8 braille dots are visible and only the selected ones are highlighted. Have a look at the colored characters in the image you provided. Can you install and use a different font in the terminal. I have good experiences with Inconsolata and Source Code Pro.

pradeepu1995 commented 6 years ago

Ok sir. I will try and let you know if that worked for me.

tammoippen commented 5 years ago

If the error persists, please reopen the issue and detail the errors.

slhck commented 1 year ago

I also thought this was a font issue. I am getting this kind of result with Source Code Pro in VS Code's integrated terminal:

image

And this with SF Mono (the default for macOS) in Terminal.app:

image

Changing the font to SF Mono in VS Code still shows the dots, so it is likely not the font itself, but some other settings. Both terminals have xterm-256color as $TERM.

tammoippen commented 1 year ago

Hi @slhck,

this still looks like a font issue in the VS Code terminal. Did you set the terminal font to SF Mono or the editor font - they can be set independently:

slhck commented 1 year ago

Hm, I've definitely set it to other fonts to check, as I can see the font change when I change the setting, and it still looks like this, also trying with Consolas or Menlo:

image

It's also not the color theme, as far as I can tell, as I can't find any VS Code theme that doesn't render it like this.