8000 Avoid decimals in Histogram Plot Python · Issue #12784 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content
Avoid decimals in Histogram Plot Python #12784
Closed
@ardiaz11

Description

@ardiaz11

Good Day,

I want to make a histogram plot in python, my dataframe has int64 values, but when i tried to make the plot this shows decimal values like this
(array([318410., 0., 0., 299533., 0., 0., 318040.,
0., 0., 321024.]),
array([1. , 1.3, 1.6, 1.9, 2.2, 2.5, 2.8, 3.1, 3.4, 3.7, 4. ]),
<a list of 10 Patch objects>)

If i print the column to graph this only has int values, but when i graph the data this shows decimal values, and i dont want shows decimal values

dataStations.stations.value_counts()
4 321024
1 318410
3 318040
2 299533
Name: stations, dtype: int64

plt.hist(dataStations["stations"])
(array([318410., 0., 0., 299533., 0., 0., 318040.,
0., 0., 321024.]),
array([1. , 1.3, 1.6, 1.9, 2.2, 2.5, 2.8, 3.1, 3.4, 3.7, 4. ]),
<a list of 10 Patch objects>)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0